I have a junction table between categories and values that indicate which categories are associated with which each value. I would like to find the values that are not associated with each category.
Category:
ID, CategoryName
1, category1
2, category2
3, category3
CategoryValue:
CategoryID, ValueID
1, 1
1, 2
2, 1
3, 2
Value:
ID, ValueName
1, value1
2, value2
3, value3
The output I would like for the query is the following:
CategoryID, ValueID, ValueName
1, 3, value3
2, 2, value2
2, 3, value3
3, 1, value1
3, 3, value3
I'm pretty stuck on how to approach this as a query. The junction table seems to prevent the usual left join where null approach. So any advice would be much appreciated.
Thank you, Andy
1, 3, value3(not value1) – ypercube Nov 16 '12 at 10:54