开发者

get the sum of a column in all rows mysql

I have a order table and I want to get the total sale till now. This table contain the column grand_total. I want to get the sum of this column from all row开发者_开发知识库s.

   order_id grand_total 
   1         10
   2         20

query should output 30

Thanks


SELECT SUM(grand_total) FROM order

Here is a reference to aggregate functions in MYSQL.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜