Hi,
I have a situation as follows:
There are four tables involved, first being "items", second "category", third "category items", and fourth being "user category"
Items contains:
ItemID
ItemName
Category contains:
CategoryID
CategoryName
Category Items contains:
ID
ItemID
CategoryId
Category Type
User Category contains:
ID
UserID
Category ID
Now, this is the logic. Items can either be in a specific 'category' or they can be under full scope. Meaning that an item doesn't necessarily have to belong to a category. Now a user can be part of a category, but doesn't nessicarily have to be part of one.
I'm trying to do the following:
Select ALL items EXCEPT items that belong to categories for which a particular user is NOT a part of IF the category type is 'restricted'. (an enum, or integer, doesnt matter).
Essentially I have to query across those four tables to get my result, but I don't know how. Any help is greatly appreciated.
Thanks in advance !