GROUP BY ROLLUP (A,B,C) HAVING A IS NOT NULL AND D NOT

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 07:59:18
GROUPBYROLLUP(A,B,C)HAVINGAISNOTNULLANDDNOTGROUPBYROLLUP(A,B,C)HAVINGAISNOTNULLANDDNOTGROUPBYROLLUP(

GROUP BY ROLLUP (A,B,C) HAVING A IS NOT NULL AND D NOT
GROUP BY ROLLUP (A,B,C) HAVING A IS NOT NULL AND D NOT

GROUP BY ROLLUP (A,B,C) HAVING A IS NOT NULL AND D NOT
GROUP BY子句里面的ROLLUP,此选项对GROUP BY 子句中的列顺序敏感,它只返回第一个分组条件指定的列的统计行.改变列的顺序会使返回的结果的行数发生变化.也就是说ROLLUP(A,B,C)的话,首先会对(A、B、C)进行GROUP BY,然后对(A、B)进行GROUP BY,然后是(A)进行GROUP BY,最后对全表进行GROUP BY操作.【另外一个GROUP BY子句的类似参数是CUBE,如果是GROUP BY CUBE(A,B,C),则首先会对(A、B、C)进行GROUP BY,然后依次是(A、B),(A、C),(A),(B、C),(B),(C),最后对全表进行GROUP BY操作.】
HAVING子句的话你可以理解为GROUP BY子句的where子句,起筛选作用的,就是先分组,然后只取A IS NOT NULL AND D NOT NULL的行.