Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Unions With Grouping Group Values

Re: Unions With Grouping Group Values

From: Tim Marshall <TIMMY!_at_PurplePandaChasers.Moertherium>
Date: Fri, 16 Sep 2005 17:25:01 -0230
Message-ID: <dgf7um$d1e$1@coranto.ucs.mun.ca>


Terry Dykstra wrote:

> An easy solution is to add another select on top of your current one:
>
> select bldg,year, sum(labour), sum(parts),sum(other)
> from (
> your original select)
> group by bldg, year
>

Thanks Terry, that sounded like I should have slapped the side of my head and yelled some Homerism, but I'm doing something wrong.

I would have thought the select outside of my original as you suggested would use the column alias(es) defined in the original union select. But I keep getting errors telling me I have invalid column names. I've tried various combinations and changes, including removing the group values and groupings in the constituent selects but nothing seems to work, yet.

Is there anything special I must keep in mind when making a select over a select?

Thanks for your help so far, hopefully, I'm forgetting something simple.

-- 
Tim    http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto  "TIM-MAY!!" - Me
Received on Fri Sep 16 2005 - 14:55:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US