summing the sum in mysql
Say If I get a resultset in mysql as :
ID count(posts)
101 2344
102 3245
103 232
104 23
Is there any way to get the tota coun开发者_StackOverflowt of count(posts) in the query itself, like this?
ID count(posts)
101 2344
102 3245
103 232
104 23
------
5844
SELECT id, COUNT(*)
FROM mytable
GROUP BY
id WITH ROLLUP
精彩评论