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
 General SQL Server Forums
 New to SQL Server Programming
 SQL Help

Author  Topic 

sql09
Starting Member

1 Post

Posted - 2009-04-11 : 19:08:39
I have a database with two tables. One table has a list of account numbers and the other table has a list of the same account numbers but does not have all them.

I am trying to create a query to display all the account that are not in the second table?

How would I go about doing that?

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-04-11 : 19:51:43
select * from tableA where account_number not in (select account_number from tableB)
Go to Top of Page

heavymind
Posting Yak Master

115 Posts

Posted - 2009-04-12 : 02:42:56
http://db-staff.com/index.php/microsoft-sql-server/56-set-operations-tsql
http://db-staff.com/index.php/microsoft-sql-server/82-universal-method-work-with-sets

Thanks, Vadym
MCITP DBA 2005/2008
Chief DBA at http://www.db-staff.com
Go to Top of Page
   

- Advertisement -