Page 1 of 1

Re: count word

Posted: Thu May 17, 2012 4:52 am
by Nullsig
To Count the number of records found you would just select a second variable "COUNT(*) from the result set.

Code: Select all

    SELECT COUNT(*) AS count, SUM( LENGTH(message) - LENGTH(REPLACE(message, ' ', ''))+1) AS sum
    FROM mdl_forum_posts WHERE userid = 29254
    AND created>=1329692400 and created<=1339279200
    Group by message
    HAVING sum>=30