WHERE status = 'Ready' AND TabId IN (SELECT TabId FROM Table2 WHERE xData IS NOT NULL) . If I run only the subselect I get an error: Invalid column name 'TabId' - and that is correct: TabId is NOT on Table2, but only on Table1 . BUT When I run the entire statement, it updates all rows in Table1..
It's ignoring the error in the subselect. Yes I know that it's because it's thinks that it is a reference out of the subselect. But how can it validate the IN () to be true ???