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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Poblems with my select query

Author  Topic 

karuna
Aged Yak Warrior

582 Posts

Posted - 2001-11-12 : 05:11:21
I have two tables called email1 and email2.email1 has around 7500+ records,email2 has 700 records.The values in email2 is also present in email1...That is 7500+ records includes the values of the 700 records in email2.
Now I want to select only the records which is not there in email2.

I tried the following 2 queries both of them are not working

select email from email1 where email1.email not in (select email from email2)

select email1.email,email2.email from email1,email2 where email1.email <> email2.email

These two queries gave me 0 records as a result.

The other way round it worked fine

Select email from email1 where email in (select email from email2)

This query returned me 698 records

If some one can help me sort this out, I'll be great full.

Regards,
Karunakaran

   

- Advertisement -