Can you help with this simple SQL query? [message #21653] |
Wed, 21 August 2002 13:36 |
Noches Bellas
Messages: 1 Registered: August 2002
|
Junior Member |
|
|
Hi, I'm a newby who's having trouble with what seems a very simple query.
Basically I have these two tables with data as shown:
Table BOAT:
----------------
ID USER_ID
10 4
11 5
Table BOAT_USERS
-----------------------
USER_ID NAME
1 Christina
2 James
3 Daisy
4 William
5 Mike
And all I want to do is a query which will give me all the USER_IDs and
NAMEs of the people who are NOT in the BOAT table. In other words, a query
which could return ONLY the USER_IDs 1, 2, and 3, and NOT 4 and 5 which are
already in the BOAT table.
I tried the following query and several variations but it din't work:
FROM BOAT_USERS U, BOAT B
WHERE B.USER_ID != U.USER_ID
So can you help me with that?
Noches Bellas
|
|
|
|
|
|