Hi
I'm trying to filter a table on where one of the column values matches ALL values in sub table... this is wot I'm doing :=
SELECT * FROM tblTasks tsk
WHERE MeasureID = ALL (SELECT MeasureID
FROM tblKeyTasks
WHERE type = tsk.Type)
It doesn't work. If I change the = to <> then it returns all the rows that aren't in the sub table, but I cannot get it to retun those that are there. Still doesn't perform as expected if I take the WHERE clause out.
Am I missing something obvious here? If not has anyone an alternative solution?
To clarify, I need to return only those rows that match ALL values (of the correct type) in tblKeyTasks
Cheers
Sam
I'm trying to filter a table on where one of the column values matches ALL values in sub table... this is wot I'm doing :=
SELECT * FROM tblTasks tsk
WHERE MeasureID = ALL (SELECT MeasureID
FROM tblKeyTasks
WHERE type = tsk.Type)
It doesn't work. If I change the = to <> then it returns all the rows that aren't in the sub table, but I cannot get it to retun those that are there. Still doesn't perform as expected if I take the WHERE clause out.
Am I missing something obvious here? If not has anyone an alternative solution?
To clarify, I need to return only those rows that match ALL values (of the correct type) in tblKeyTasks
Cheers
Sam