A A2
---------- ----------
6 5
7 5
8 5
5
1 4
2 4
3 4
4
19 rows selected.
使用cube分组拓展结果:
HR@ORA11GR2 > select a, a2 from a group by cube(a, a2) order by a2 desc;