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 |
akpaga
Constraint Violating Yak Guru
331 Posts |
Posted - 2008-05-12 : 11:54:27
|
Hi I have two tables. One table called customers contains the records for all the customers of my firm. I have another table called "general"which contains the details of all people(who are either my customers or not).I want to compare my "general" table with my customers table to find out those who are not my customers using the name fields in both the tables.how can i do that. Thanks in advance |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-12 : 11:58:49
|
[code]select g.*from general g left join customers con g.name = c.namewhere c.name is null[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-12 : 12:01:51
|
or:-SELECT * from general where name not in (select name from customers) |
 |
|
akpaga
Constraint Violating Yak Guru
331 Posts |
Posted - 2008-05-12 : 12:27:05
|
Thaks for the response |
 |
|
|
|
|