Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Outer Join confusion
bbcrock_at_gmail.com wrote:
> My brain is shot. Can anyone assist me with building this query? I
> have 4 queries right now building 4 result sets, essentially:
>
> select typename from typelookup
>
> select typename, sum(decode(amount,0,planned_amount,amount)) as
> statussummary
> from item
> where status = 1
>
> select typename, sum(decode(amount,0,planned_amount,amount)) as
> statussummary
> from item
> where status = 4
>
> select typename, sum(decode(amount,0,planned_amount,amount)) as
> statussummary
> from item
> where status in (1,4)
>
> I'd like to have a single result set with all the typenames, and the
> summary values for each status and both statuses, but for some reason I
> can't figure out the correct outer join syntax. Can anyone help out?
> Four queries like this are not useful.
>
> The names have been changed to protect the innocent.
>
> Don
And GROUP BY won't do it? Why?
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Wed Oct 26 2005 - 00:34:35 CDT