group by

select a,b from aa 

a       b
1	1
2	2
1	3
1	4
2	5


select a,sum(b) from aa  group by a

a     sum(b)
1	8
2	7

猜你喜欢

转载自xiangjie88.iteye.com/blog/2296477