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

Home -> Community -> Usenet -> c.d.o.misc -> Outer Join confusion

Outer Join confusion

From: <bbcrock_at_gmail.com>
Date: 25 Oct 2005 13:57:32 -0700
Message-ID: <1130273852.706922.259390@g47g2000cwa.googlegroups.com>


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 Received on Tue Oct 25 2005 - 15:57:32 CDT

Original text of this message

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