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 -> Select statement on 2 linked tables

Select statement on 2 linked tables

From: Matthieu DEGLIN <mdeglin_at_remove-me.partner.auchan.com>
Date: Wed, 10 Oct 2001 15:18:22 +0200
Message-ID: <9q1hdv$5le$1@reader1.imaginet.fr>


I've 2 tables T1 et T2. Those tables are linked by two fields: T1.K1 / T2.K1 and T1.K2 / T2.K2.

I'm trying to build a request that give me T1.val1, T1.val2, T2.val1, T2.val2 EVEN IF there isn't any lines in T2 linked to T1. In this case, the fields T2.val1 and T2.val2 should be returned NULL.

The following request doesn't work !

SELECT T1.val1, T1.val2, T2.val1, T2.val2 FROM T1, T2
where T1.K1 = +(T2.K1)
and T1.K2 = +(T2.K2)

It returns only T1 values for which a T2 is linked to.

Can somebody help me ?

Thanks for Help. Received on Wed Oct 10 2001 - 08:18:22 CDT

Original text of this message

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