sum and group by

admin

Administrator
Staff member
Please help.

I have (3) records in itemtable

ticketid total
1 1.25
1 2.50
2 1.25

where ticketid is int and total is float(5,2)

when running this query:

"select ticketid,sum(total) from itemtable group by ticketid"

the results are:

ticketid total
1 1.25
2 0.00

is this something MySQL can't do or this is not the correct syntax?

Thanks,
Allen.
 
Back
Top