Re: Can someone help me with this BASIC SQL query

From: D.Y. <dyou98_at_aol.com>
Date: 22 Mar 2003 21:11:28 -0800
Message-ID: <f369a0eb.0303222111.65e2cd25_at_posting.google.com>


You need a rollup SQL. Look up the GROUPING function in the SQL reference guide or data warehouse guide.

"CL" <thecure_at_rcn.com> wrote in message news:<b5i09g$jqo$1_at_bob.news.rcn.net>...
> I am a bit rusty on SQL and need to quickly come up with a query against
> fiels like this:
> assume DIVISION, DEPT, DATE, REVENUE and get output GROUPED by DIVISION and
> DEPT and DATE and with SUM(REVENUE) ... Im having trouble with the
> combination of BREAK and GROUP...
> i.e. I want to get the SUB-TOTALS working... If I want to get this output
> what SQL do I use???
>
>
> DIV1:
> DEPT1:
> Month 01 ... Revenue
> Month 02 ... Revenue
> ...
> Year total: Total of above Revenue for DEPT1
> DEPT2:
> Month 01
> (same as above)
> DIV2:
> DEPT 21:
> Month 01 ... Revenue
> (Same as above)
>
>
> Total of all DIVISIONS...
>
>
> THANK YOU!!!
Received on Sun Mar 23 2003 - 06:11:28 CET

Original text of this message