1.我们用group by 的时候:
select zongfenshu ,xuehao from aaa group by xuehao ,zongfenshu order by xuehao
语句运行结果:
2.我们用compute 的时候:
select xuehao,zongfenshu,dengji from aaa order by xuehao compute sum(zongfenshu)
语句运行结果:
3.我们用compute by 的时候:
select xuehao,zongfenshu,dengji from aaa order by xuehao compute sum(zongfenshu) by xuehao
语句运行结果: