Limiting a query based on entries in a table?
Posted on 2008-10-29
I have the following:
from Objects O
Inner JOIN metadata fs on fs.ID = O.ID
Inner JOIN DestructionList MS ON ms.ID = O.ID
where O.Status = 5 AND MS.ID IS NOT NULL AND fs.Type = 'DataTable'
I have 3 tables
The destructionlist tracks the ObjectID and a value for that object which is to be detroyed.
Objects & MetaData stores information.
So what I am trying to do is to join
Objects & MetaData where ID's match
and then join DestructionList where the ID or the Value are not contained within the destructionlist. There are instances where I may have multiple ObjectID's which are the same, but the value's are different, so I need to make sure that I show objects which are not in the destructionlist.
Any help would be much appreciated.