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: Views

Re: Views

From: Michael Serbanescu <mserban_at_postoffice.worldnet.att.net>
Date: 1998/02/26
Message-ID: <6d35es$5mi@bgtnsc02.worldnet.att.net>#1/1

Try this:

CREATE OR REPLACE VIEW person_phones (id, NAME, Celphone#, Homephone#) AS SELECT t1.id AS id, t1.NAME AS NAME, t2.Phnumber AS Celphone#, t3.Phnumber AS Homephone#
FROM person t1, phone t2, phone t3
WHERE t1.cellphonID = t2.id
AND t1.homePhonID = t3.id
WITH CHECK OPTION; Hope this helps.

Michael Serbanescu



geetha_sanjeeviah_at_p-com.com wrote:
>
> 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
Received on Thu Feb 26 1998 - 00:00:00 CST

Original text of this message

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