troubleshooting Question

question about results where i dont have a match

Avatar of jamesmetcalf74
jamesmetcalf74Flag for United States of America asked on
Microsoft SQL ServerSQL
3 Comments2 Solutions95 ViewsLast Modified:
lets say I have a table called "billing"  that has thousands of accounts and then inside the billing table there  is a column called optionskey.  the column optionskey can be anyone of 100 numbers.  4 digits.  this column corresponds to an optionskey table that describes the option.

ie... optionskey will translate to garbage... or water.

so I have a query with 200 possible options keys.

so I would run a query that says... select * from billing where optionskey in ('1001', 1002,'1115',etc....)
in the parenthesis, I want to supply it 200 optionkeys.  I want to know which optionskeys are not in the table....

example table

accountnumber optionskey
1111                        1004
2222                        1005

select * from billing where optionskey in ('1004', '1005', '1006')
I would like to know that there was no hit for an optionskey of '1006'

any ideas
Mike Eghtebas
Database and Application Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros