Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Newbie SQL question...
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