Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unions With Grouping Group Values
In your original query, don't use the lower case and/or space in the aliases
you are using. That just causes grief.
-- Terry Dykstra Canadian Forest Oil Ltd. "Tim Marshall" <TIMMY!@PurplePandaChasers.Moertherium> wrote in message news:dgf7um$d1e$1_at_coranto.ucs.mun.ca...Received on Fri Sep 16 2005 - 16:09:34 CDT
> 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