bulduing a select to get excluded datas

From: <robertdeniro_at_consultant.com>
Date: 4 Apr 2005 18:10:10 -0700
Message-ID: <1112663410.662034.146260_at_z14g2000cwz.googlegroups.com>



Hello, I have a problem because I am trying to find results from a select statement, where the datas from the first table are the ones that are NOT included in the second tables.

I have a table containing the list of known users: users_list

map_id,		->id refering to another table
rank,		->rank of the user

other datas...

several entries can have the same map_id, the key of this table is the association of (map_id, rank)

and I the table of users : users

map_id,
datas about the user.... -> several rows of datas for this particular user

The table "users" can have users that are not yet known, therefore they are not in the "users_list" table

I want to write a web page that takes any users that is not known yet, so I can fill the missing datas and add the user in the users_list The difficulty is that one known user can have several ranks so to display the list of users that are not yet known, I tried the following statement:

select users.map_id,users_list.rank from users,users_list where users.map_id!=users_list.map_id

but it doesn't work! I get multiple entries of "map_id" joined with "rank"
what I want is the list of all references "map_id" in the table "users" for which the map_id is not included in the table "users_list"

If anyone can help me, I'd be very thankful, because I'm lost! Received on Tue Apr 05 2005 - 03:10:10 CEST

Original text of this message