Given the following table FOO;
| Org | Status | | X | CLOSED | | X | OPEN | | Y | OPEN | | Y | CLOSED |
How can I select all the records except where org = Y and status = CLOSED
So the resultset looks like:
| Org | Status | | X | CLOSED | | X | OPEN | | Y | OPEN |
Advertisement
Answer
You can do this either of these ways:
WHERE (org, status) <> ('Y','CLOSED')
WHERE NOT (org = 'Y' AND status = 'CLOSED')