Mysql Hacks

 

统计某个字段中单词的数量

SELECT SUM( LENGTH( bodytext ) -  LENGTH( REPLACE( bodytext, ' ', '' ) ) +1 )
FROM tt_content