我有这样的mysql查询的表事务。
____________________________________________________________
| id | noskom | nonpbm | noskop | npbp |
|____|_____________|____________|_____________|_____________|
| 1 | 001 | 10 | 20 | 20 |
| 2 | 001 | 20 | 10 | 20 |
| 3 | 002 | 5 | 10 | 20 |
| 4 | 003 | 30 | 5 | 20 |
|____|_____________|____________|_____________|_____________|
我想要结果
select sum(nonpbm),sum(noskop),sum(npbp) from transaction group by noskom
____________________________________________________________
| id | noskom | nonpbm | noskop | npbp |
|____|_____________|____________|_____________|_____________|
| 1 | 001 | 30 | 30 | 40 |
| 2 | | | | |
| 3 | 002 | 5 | 10 | 20 |
| 4 | 003 | 30 | 5 | 20 |
|____|_____________|____________|_____________|_____________|
什么是mysql查询