Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-05-26 : 09:27:52
|
| Jeremiah writes "Platform:SQL Server 2000Windows NT 4.0 Service pack 6Question:I have "table1" with customer records and phone numbers and "table2" with phone numbers. I want to join the two tables and return only the records from "table1" that were not equal to the phone numbers in "table2".I can only seem to get the ones that are = and not !=.Thanks for your help in advance." |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-05-26 : 10:12:31
|
| You need an OUTER JOIN here:SELECT table1.CustomerName, table1.PhoneNumberFROM table1 LEFT OUTER JOIN table2 ON table1.PhoneNumber = table2.PhoneNumberWHERE table2.PhoneNumber IS NULLOS |
 |
|
|
|
|
|