1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* syntax version 1 */ /* postgres can not */ $s = ( select 1 as x, 2 as y ); select x as x2, y from $s group by rollup( x, y ) order by x2, y;