Where is the spec for "grand total" in oracles group by grouping sets?
This is a valid sql statment for oracle 11 sql:
select LASTNAME, SUM(ID) from PERSON group by grouping sets ((LASTNAME), ())
But I can not find the specification for the grand total "()" in the Oracle® Database SQL Language Reference. Can someone please show me where I开发者_StackOverflow can find the specification for this?
You mean this?
Why not just:
select lastname, sum(id)
from person
group by rollup(lastname);
This should give you the total you seek.
精彩评论