Re: bulduing a select to get excluded datas

From: Theo Peterbroers <peterbroers_at_floron.leidenuniv.nl>
Date: 4 Apr 2005 23:52:48 -0700
Message-ID: <39bb2c10.0504042252.41b6c43e_at_posting.google.com>


robertdeniro_at_consultant.com wrote in message news:<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.
>
8<--------Snip
>
> 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"
That's what the query says:
Compare all map_id's in users to all map_id's in users_list. From any pair of rows, if they don't match return map_id from users and rank from users_list.

> 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"
>

Your problem as stated is almost SQL
> select statement, where the datas from the first table are the ones
> that are NOT included in the second tables.
In SQL "not included" is written "NOT EXISTS" Received on Tue Apr 05 2005 - 08:52:48 CEST

Original text of this message