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.
精彩评论