Reputation: 86346
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 rows.
order_id grand_total
1 10
2 20
query should output 30
Thanks
Upvotes: 5
Views: 7382
Reputation: 1248
SELECT SUM(grand_total) FROM order
Here is a reference to aggregate functions in MYSQL.
Upvotes: 8