please i have two columns-col1 and col2, col1 contain item and col2 contain the quantity of the item
col1 col2 Key 4 Soap 5 seat 4 Key 3 Soap 4
how will i query the database to sum the Items and display output so that it will be like this col1 col2 Key 7 Soap 9 Seat 4
hi friend, use MySQL(group by) keyword to solve your problem. Here I am giving a sample SQL query hope this will helpful for you.
select item, sum(quqantity) from `order` group by item