Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Newbie SQL question...

Newbie SQL question...

From: davout <davout_at_dial.pipex.com>
Date: Fri, 22 Oct 1999 19:58:12 +0100
Message-ID: <7uqc6a$cp0$1@lure.pipex.net>


I have three tables...

EntryMaster...
EntryUId INTEGER
EntryTitle VARCHAR

EntryDetail...
UserID INTEGER
EntryUID INTEGER

SystemUser...
UserID INTEGER
UserName VARCHAR

The data is like...

EntryMaster...
EntryUID EntryTitle

1                London
2                New York
3                Tokyo

SystemUser...
UserID UserName

1                Joe Bloggs
2                Adam Smith

EntryDetail...
UserID EntryID

1                1
1                3
2                  2

How can I build a SQL query that will return for me whether a record exists for a given user for each of the EntryMaster records?

For SystemUser 1, the results would look like...

EntryUID   EntryTitle        Exist
1                London            Yes
2                New York        No
3                Tokyo                Yes

For SystemUser 2, the results would look like...

EntryUID   EntryTitle        Exist
1                London            No
2                New York        Yes
3                Tokyo               No

TIA     .... davout Received on Fri Oct 22 1999 - 13:58:12 CDT

Original text of this message

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