Saturday, 15 May 2010

mysql - How to add a SELECT statement result? -



mysql - How to add a SELECT statement result? -

i have db running below command. aim show hours field each row date equal 02/08/2013. want add together results , display total amount.

select hours resource date = '02/08/2013';

current results 20 40 18. want output total 78.

i have tried below, counts results, 3.

select count(hours) resource date = '02/08/2013'

any suggestions appreciated.

you can use,

select sum(hours) resource date = '02/08/2013';

sql fiddle output

mysql sql sqlite

No comments:

Post a Comment