You can use a non-correlated subquery in a WHERE clause along with these operators:
- IN: This will return results in the outer query where the results are in the inner query. If the inner query returns even one NULL value, then there will be no outer query results. This is because IN can evaluate to either true, false, or NULL. The following code block shows some sample syntax:
SELECT column(s)FROM tableaWHERE col1 IN (SELECT col FROM tableb WHERE condition(s));
- NOT IN: This will return results in the outer query where the results are not in the inner query. If the inner query returns even one NULL value, then there will be no outer query results. This is because NOT IN can evaluate to either true, ...