how do i combine similar value rows into one without affecting the rest?

You cannot get the data you want to display. You will be getting company name being repeated. If you want to dispaly data in the way, where company name is not repeating for subsequent rows, you have to use EXCEL or some other presentation layer tool.

SELECT Company, ID, SUM(Amount)
FROM Table1
GROUP BY Company,ID

+---------+-----+--------+
| Company | ID  | Amount |
+---------+-----+--------+
| ABC     | 001 |      3 |
| ABC     | 002 |      3 |
| DEF     | 002 |     10 |
| DEF     | 003 |      5 |
+---------+-----+--------+

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top