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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

php - Need to store a large amount of data in session with CI 3 but on storing large data in session it is itself destorying automatically -