How I count the no of rows returned from this below query
SELECT * FROM ( SELECT * FROM data ORDER BY time) AS t1 GROUP BY fbid ORDER BY time
How I count the no of rows returned from this below query
SELECT * FROM ( SELECT * FROM data ORDER BY time) AS t1 GROUP BY fbid ORDER BY time
Try this:
SELECT *
FROM
( SELECT * FROM data ORDER BY time) AS t1
GROUP BY fbid
ORDER BY time
INNER JOIN
SELECT COUNT(fbid) AS 'row count'
FROM
( SELECT * FROM data ORDER BY time) AS t2
GROUP BY fbid
ORDER BY time
ON (t1.fbid=t2.fbid)