看起来好像很简单,但是如何都做不来,求一条SQL
看起来好像很简单,但是怎么都做不来,求一条SQL
Category qty uncost
1 20 300
1 12 300
2 31 120
2 222 123
用sql语句如何实现
Category qty uncost
1 32 600
2 253 243
在线等
------解决方案--------------------
select Category,sum(qty) as qty,sum(uncost) as uncost
from 表名
group by Category
Category qty uncost
1 20 300
1 12 300
2 31 120
2 222 123
用sql语句如何实现
Category qty uncost
1 32 600
2 253 243
在线等
------解决方案--------------------
select Category,sum(qty) as qty,sum(uncost) as uncost
from 表名
group by Category