I'm trying to select rows from a table that meet a bunch of criteria, but one of the criteria is that a row doesn't already exist with two matching columns both being true at the same time. For example, suppose table t1 has columns: a, b, c and d
Here's what I'm trying, but it's giving me a syntax error ...
SELECT *
FROM t1
WHERE a, b NOT IN
(
SELECT a, b
FROM t1
WHERE c = 5 AND d = 6
)
AND b NOT IN (1, 2, 3, 4)