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 -> Re: EXTERN JOINS Lookup !!!!

Re: EXTERN JOINS Lookup !!!!

From: Andrew Babb <andrewb_at_mail.com>
Date: Wed, 21 Apr 1999 09:50:48 +0800
Message-ID: <371D2EF8.F02B71BA@mail.com>


The statement would be;

select d.n_disciplina, d.cod_curso, d.ano, d.disciplina, i.value   from disciplins d

     , insc i

 where d.n_disciplina = i.n_disciplina (+)
   and d.cod_curso = i.cod_curso (+)
   and d.ano = i.ano (+)


Thats it.

Andrew

jricardo_at_ipb.pt wrote:

> Hi there:
>
> I've 2 tables joined by three fields belonging to the primary key... I want
> to select all the rows that i have in the tables disciplins even if they dont
> exist in the table insc
>
> For example
>
> Table disciplins
> -------------------------------------------------------
> n_disciplina cod_curso ano disciplina
> -------------------------------------------------------
> 1001 285 1994 computer science
> 1002 285 1994 mathemathics
> 1003 285 1994 philosophy
>
> Table insc
> ------------------------------------------------------------
> n_disciplina cod_curso ano disciplina value
> ------------------------------------------------------------
> 1001 285 1994 computer science 15
> 1003 285 1994 philosophy 10
>
> What i want to retrieve is
> Table insc
> ------------------------------------------------------------
> n_disciplina cod_curso ano disciplina value
> ------------------------------------------------------------
> 1001 285 1994 computer science 15
> 1002 285 1994 mathemathics null (*)
> 1003 285 1994 philosophy 10
>
> I think this is made with a where clause (+) ... but i've done it and i did
> that and i didn't get these results...
>
> Disciplins
> ----------
> #n_disciplina
> #cod_curso
> #ano
> disciplina
> ...
>
> Insc
> ----
> #n_disciplina
> #cod_curso
> #ano
> value
>
> If anyone can explain me ... thanks...
>
> --
> Thankx
> If you know how to help me mail me to jricardo_at_ipb.pt
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Tue Apr 20 1999 - 20:50:48 CDT

Original text of this message

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