![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can anyone tell me how I would run a query to give me a set of members that are in one set but not in another? In other words, I have customers in dataset A and customers in dataset B and I want to run a query that will produce those customers in A but not in B. |
#3
| |||
| |||
|
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, You'd use a LEFT JOIN query. E.g.: SELECT R1.<columns FROM <dataset 1> AS R1 LEFT JOIN <dataset 2> AS R2 ON R1.<column> = R2.<column WHERE R2.<column> IS NULL The above query would return all records in dataset 1 (R1) that are not in dataset 2 (R2). The ON clause <column> would have to be a column in both datasets that hold the same info (e.g.: social security numbers). The WHERE clause <column> should be the same as the ON clause <column>; this will force the query to return only those records in dataset 1 that are not present in dataset 2. HTH, MGFoster:::mgf Oakland, CA (USA) -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBPyeZtYechKqOuFEgEQLLbACeKwthxpz0aBhtFWzfMjAaPP a2hX8AoOvM G9pB3h0FDu90fsWGyik+ECwq =ZTby -----END PGP SIGNATURE----- Chris Koch wrote: Can anyone tell me how I would run a query to give me a set of members that are in one set but not in another? In other words, I have customers in dataset A and customers in dataset B and I want to run a query that will produce those customers in A but not in B. |
![]() |
| Thread Tools | |
| Display Modes | |
| |