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
 SQL Server Development (2000)
 SQL Statement Help

Author  Topic 

RichardSteele
Posting Yak Master

160 Posts

Posted - 2002-10-25 : 18:37:02
I need to select emails from table1 that excludes emails found in table2.

SELECT Email
FROM table1

How do I rewrite the above select statement to exclude table2 emails?

Thanks in advance.

MichaelP
Jedi Yak

2489 Posts

Posted - 2002-10-25 : 19:23:45
Red this article, t should tell you how to accomplish it. It's really short.

http://www.sqlteam.com/item.asp?ItemID=448

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

RichardSteele
Posting Yak Master

160 Posts

Posted - 2002-10-25 : 20:54:47
Thanks for the reply. However, I can't seem to find the answer to my problem.

I have two tables, each one having email addresses. There may be some duplicates of emails in table2, but many are unique. There are no id numbers that relate the two tables.

Is it possible to write one Select statement that will include all emails from both tables without duplication?

Thanks in advance.



Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2002-10-26 : 00:27:56
Hi
You can use Union operator that will give u unique email ids from both the tables.
Hope this works


Go to Top of Page
   

- Advertisement -