From: GreMa@t-online.de (Matthias Gresz)
Subject: Re: Views
Date: 1998/02/26
Message-ID: <6d35vn$ns6$1@news00.btx.dtag.de>#1/1
Content-Transfer-Encoding: 8bit
References: <6d2e03$8k5$1@nnrp1.dejanews.com>
X-Sender: 0722193570-0001@t-online.de
Content-Type: text/plain; charset=iso-8859-1
Organization: T-Online
Mime-Version: 1.0
Reply-To: GreMa@t-online.de
Newsgroups: comp.databases.oracle.server



On Wed, 25 Feb 1998 18:45:55 -0600, geetha_sanjeeviah@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@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@T-online.de



