SUM on values of duplicate row in MYSQL -
i have burning question. running mysql query returns rows duplicate values in it. that's no problem because that's how saved data in past. want label stay same, value (int) must summed. have no clue how this. can me please?
label |count | _________________ shelves |15 | pictures |39 | chairs |19 | tables |41 | shelves |49 | cabinets |16 |
so want count summed in mysl when label duplicate. appreciated!
thanks in advance!
you can use group by
sum
, e.g.:
select label, sum(`count`) table group label;
Comments
Post a Comment