01 SELECT 'Individual',
02 LAST_NAME || ', ' || FIRST_NAME
03 FROM CRUISE_CUSTOMERS
04 UNION
05 SELECT CATEGORY,
06 VENDOR_NAME
07 FROM VENDORS
08 ORDER BY 2;
When using ORDER BY with a series of SELECT statements
connected with set operators, you can only use ORDER BY once, at the end
------------------
For every n groups, ROLLUP produces n+1
groupings.
groupings.
For n expressions, CUBE returns 2 to the nth power groupings.
指示是否聚合 GROUP BY 列表中的指定列
表达式。在结果集中,如果 GROUPING 返回 1 则指示聚合;返回 0 则指示不聚合。如果指定了 GROUP BY,则 GROUPING 只能用在 SELECT 列表、HAVING 和 ORDER BY 子句中。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22327710/viewspace-764166/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22327710/viewspace-764166/