Page 1 of 1

MySQL query, total amount

Posted: Thu Dec 30, 2010 3:53 pm
by JKM
Hi,
how do get the total amount from a field? Example (paid):
`id`, `paid`, `timestamp`
1, 200, 21321321
2, 250, 34543534
3, 50, 12332453
Result should then be (200+250+50=500).

Re: MySQL query, total amount

Posted: Thu Dec 30, 2010 4:20 pm
by Darhazer
SELECT SUM(paid) as total FROM tablename;