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 -> Oracle SQL outer join problem

Oracle SQL outer join problem

From: <rplj_at_hotmail.com>
Date: Tue, 08 Feb 2000 15:35:53 GMT
Message-ID: <87pd4p$l5p$1@nnrp1.deja.com>


Hello,

I have an Oracle8i Enterprise database containing some tables:

Product : Products list;
Stock   : Product stocks by filial;
Group   : Products have group codes from this table;
Price   : Product price list by product and filial;

I've tried to join these guys together by using the following statement:

select p.code,
       p.description as PrdDescr,
       g.description as GrpDescr,
       s.available,
       s.reserved,
       pr.price1,
       pr.price2

from product p, stock s, group g, price pr
where p.group_code   = g.code
and   p.code         = s.product_code(+)
and   p.code         = pr.product_code(+)
and   s.filial_code  = pr.filial_code
and   s.filial_code  = 1;

See that it's in fact an Oracle outer join, because I need ALL products, even the ones without stocks or price, to be included in the result set.

But the select is just returning products having stocks and price. Does anybody can help me to fix it?

Thanks in advance,

Ruy Ponce de León Jr.
Systems Analyst
Novaera Net
Recife-PE Brasil
http://www.novaera.com.br

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Feb 08 2000 - 09:35:53 CST

Original text of this message

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