sql rollup and cube

group by rollup(a,b,c)则产生

group by (a,b,c),group by (a,b) group by (a) group by(0)四种分组汇总

group by cube(a,b,c) 则产生 

group by (a,b,c),group by (a,b) group by (a,c) group by (b,c),group by (b) group by (a) group by (c),group by (0) 八种分组汇总


grouping(column)与 rollup cube联用 返回0或1

group by grouping sets((column,column),(column,column))


另:start with 

connect by prior

你可能感兴趣的:(SQL)