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 2008 Forums
 Transact-SQL (2008)
 Query to find non matches?

Author  Topic 

taunt
Posting Yak Master

128 Posts

Posted - 2014-02-13 : 17:25:19
Hello, I have a table Labels with a column named LabelID. What I'm trying to do is find the non matches from a list of LabelIDs. Take I was looking for ABCD, DEFG, and GHIJ. Take that ABCD and GHIJ were in the database, but DEFG wasn't is there a way to have it show me any non matches from that query? So the resule from that qery would show me DEFG wasn't in the database.

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-02-13 : 17:51:19
Is there another table that contains the list of items you are searching for? Or is this an input parameter? Please provide more info regarding what it is searching.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

taunt
Posting Yak Master

128 Posts

Posted - 2014-02-13 : 18:11:49
Nope there isn't another database to compare too.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-02-13 : 18:15:24
You misunderstood me. Where is the list coming from?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

taunt
Posting Yak Master

128 Posts

Posted - 2014-02-13 : 18:36:17
It's in a .doc file, that I paste the labelid in sql.
Go to Top of Page
   

- Advertisement -