求汇总Sql 在线等
表结构如下:
Type Parent ChildType Number
2 6 2 500
2 6 1 600
1 3 1 300
1 3 1 500
1 3 2 100
3 1 1 100
3 1 2 100
3 1 2 900
ChildType 取值为1和2
需得以下汇总结果(根据ChildType的值对Number求和):
Type Parent SumChildType1 SumChildType2
1 3 800 100
2 6 600 500
3 1 100 1000