INNER JOIN query

G

Guest

I have two tables that I am trying to cross reference.

Table 1 contains a single column list of telephone numbers

Table 2 contains two columns. Column 1 contains people's names and column 2
contains their telephone number.

Having received help from this forum I'm now able to cross reference the two
tables to get a list that shows the name of each person that is associated
with each of the telephone numbers in Table 1, (using an INNER JOIN query).

What I would now like to do is produce a list of the telephone numbers in
Table 1 that could not be matched to the telephone numbers in Table 2.

I have tried reversing the INNER JOIN Query but without success.

Please help, as trying to work out manually what numbers could not be
matched is driving me MAD!
 
D

David Lloyd

Try something like the following:

SELECT Table1.TelephoneNumber
FROM Table1 LEFT JOIN Table2 ON Table1.TelephoneNumber =
Table2.TelephoneNumber
WHERE Table2.TelephoneNumber is NULL

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


I have two tables that I am trying to cross reference.

Table 1 contains a single column list of telephone numbers

Table 2 contains two columns. Column 1 contains people's names and column 2
contains their telephone number.

Having received help from this forum I'm now able to cross reference the two
tables to get a list that shows the name of each person that is associated
with each of the telephone numbers in Table 1, (using an INNER JOIN query).

What I would now like to do is produce a list of the telephone numbers in
Table 1 that could not be matched to the telephone numbers in Table 2.

I have tried reversing the INNER JOIN Query but without success.

Please help, as trying to work out manually what numbers could not be
matched is driving me MAD!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top