If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
comparing tables
Does anyone know how I could find all the values in one table that are not in another?
I have a table named login; the fields are ID, first_name, last_name... I have another table named tb; the fields are ID, tb_ID, and last_tbdate. Here's the relationship: ID.login ---------- tb_ID.tb The ID fields in both tables are unique key autonumber. EX. login: ID first_name last_name 1 jeremy scott 2 john doe 3 jane michaels 4 brian peterson 5 bill gates EX. tb ID tb_ID last_tbdate 1 1 09/02/2003 2 1 09/01/2002 3 3 09/05/2004 4 5 09/10/2003 5 5 09/10/2002 The answer should be: first_name last_name john doe brian peterson because neither john nor brian have any records in the tb table. i can't seem to get this to work and any halp would be much appreciated thanks |
#2
|
|||
|
|||
SELECT login.first_name, login.last_name
FROM login LEFT JOIN tb ON login.ID = tb.tb_ID WHERE tb.tb_ID Is Null; Tonín escribió en el mensaje k.net... Does anyone know how I could find all the values in one table that are not in another? I have a table named login; the fields are ID, first_name, last_name... I have another table named tb; the fields are ID, tb_ID, and last_tbdate. Here's the relationship: ID.login ---------- tb_ID.tb The ID fields in both tables are unique key autonumber. EX. login: ID first_name last_name 1 jeremy scott 2 john doe 3 jane michaels 4 brian peterson 5 bill gates EX. tb ID tb_ID last_tbdate 1 1 09/02/2003 2 1 09/01/2002 3 3 09/05/2004 4 5 09/10/2003 5 5 09/10/2002 The answer should be: first_name last_name john doe brian peterson because neither john nor brian have any records in the tb table. i can't seem to get this to work and any halp would be much appreciated thanks |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Comparing two tables | Daniel | Running & Setting Up Queries | 1 | June 14th, 2004 09:19 PM |
comparing two tables | Spiro | General Discussion | 1 | June 5th, 2004 01:43 PM |
comparing two tables | ADAK | Running & Setting Up Queries | 1 | May 28th, 2004 06:07 PM |