Re: [HELP] Please, help with a simple SELECT statment

From: CHAPUIS Benoit Orange/DF/DCCG <benoit.chapuis_at_francetelecom.com>
Date: Wed, 18 Jun 2003 11:17:52 +0200
Message-ID: <3EF02E40.A314318B_at_francetelecom.com>


I think you could try this :

SELECT * FROM STUDENTS,TUTORS

                  WHERE STUDENTS.Tut ID=(+) TUTORS.Tut ID;

It should present all students, even if they have no tutor (thats the mea ning of
the +).

Good luck

Beno?
"Juan Guillermo Fern?dez V." a ?rit :

> Hi everybody.
>
> I've been working for a just a while now with Oracle (or with any DB fo
 r
> that matter. I'm really new to all this), and I've encountered a proble
 m I
> can't find a solution to.
>
> I've created a table... let's call it "STUDENTS". It has a Primary Key
 field
> (St ID) and a bunch of other fields. It also has a Foreign Key (Tut ID)
 , an
> dientification for his Tutor, a reference to the TUTORS table. The thin
 g is,
> a student MAY or MAY NOT have a tutor, so the Foreign Key field Tutor M
 AY or
> MAY NOT have data; id est, it May have an ID number, or else it will be
 

> NULL.
>
> Now, here's where I'm having the problem. When I do a simple:
>
> SELECT * FROM STUDENTS,TUTORS
> WHERE STUDENTS.Tut ID=TUTORS.Tut ID;
>
> it shows me only those rows WITH something on the Tut ID field... and I
 was
> hoping (and need) to list every row ond STUDENTS, adding the Tutor data
 when
> it's present, ommiting it (empty fields) when is not...
>
> Maybe there is an obvious way to do this, just a simple instruction...
 but
> I'm reourceless on this.
>
> Pleasy. Any help would be enourmosly appreciated. thanks!
>
> PS: Sorry for my english, if it tourns out inintelligible or horrible
> misspelled.
Received on Wed Jun 18 2003 - 11:17:52 CEST

Original text of this message