How to merge values of two rows into single row for same id?

前端 未结 2 1263
广开言路
广开言路 2021-01-27 07:32

I have data in a table(list) as shown below,

 id      no1   no2
 1000    0     511
 1000    820    0

I need data like shown below,



        
2条回答
  •  面向向阳花
    2021-01-27 08:09

    simple group by with summation will work for you

    SELECT 
      ID,
      SUM(NO1) NO1,
      SUM(NO2) NO2
    FROM Table1
    Group by ID
    

提交回复
热议问题