开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜