Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Views
On Wed, 25 Feb 1998 18:45:55 -0600, geetha_sanjeeviah_at_p-com.com wrote:
Hi,
try
SELECT
per.NAME, NVL(p1.PHNumber,'NONE'), NVL(p2.PHNumber,'NONE')
FROM
person per, phone p1, phone p2
where
p1.id (+) = per.cellphonid
AND
p2.id (+) = per.homephonid
;
>Hi ;
>
>I have a question about views using multiple tables.
>
>I have a table called person table:
>
>It has the following fields.
>
>id PRIMARYKEY
>NAME NOT NULL
>cellphonID FOREIGNKEY REFERENCES PHONE(ID);
>homePhonID FOREIGN KEY REFERENCES PHONE(ID);
>
>The table phone has the following:
>
>id PRIMARY KEY
>Phnumber NOT NULL
>
>I want to create a view using the above so that I can have the name, and
>both the telephone numbers for that person.
>
>How do I write my select statement?.
>
>Please direct all the responses to geetha_sanjeeviah_at_p-com.com.
>
>Thanks
>Gita
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
-- Regards Matthias Gresz :-) GreMa_at_T-online.deReceived on Thu Feb 26 1998 - 00:00:00 CST