mcunn
asked on
Match all fields against a lookup table
Hi Experts,
Forgive me if this is a basic question but I haven't been able to find a resource online that answers this.
I'm trying to apply an array of conditions to a SQL SP. To do so I want to take a lookup table
RecipeID, CategoryID
1,1
1,2
2,1
2,2
2,3
2,5
3,4
4,1
4,2
4,3
4,4
and return the RecipeID's for all records that match ALL of the variables in a table variable
CategoryID
1
2
3
With results like:
Result
2
4
Any Hints?
Thanks!
Michael
Forgive me if this is a basic question but I haven't been able to find a resource online that answers this.
I'm trying to apply an array of conditions to a SQL SP. To do so I want to take a lookup table
RecipeID, CategoryID
1,1
1,2
2,1
2,2
2,3
2,5
3,4
4,1
4,2
4,3
4,4
and return the RecipeID's for all records that match ALL of the variables in a table variable
CategoryID
1
2
3
With results like:
Result
2
4
Any Hints?
Thanks!
Michael
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually, this doesn't solve the issue...
This pulls ANY matches... I need it to pull matches that ALL fields match.
This pulls ANY matches... I need it to pull matches that ALL fields match.
ASKER