I have a very large sql statement I have to make a modification to. In one of the tables there are four int columns and I have to exclude 2 sets. If I just want to exclude the values for one table it is pretty simple, use an except statement. I can do this:
select *
from Table Z
except(
select *
from Table Z
where (A= 2 and B= 10 and C= 3 and D= 90)
or (A= 2 and B= 17 and C= 100 and D= 90))
However I can’t get it to work using a where statement. I only want those two sets of combinations excluded. In the real statement there is a join with six different tables and all kinds of case statements in the select.
I have tried a few things and nothing seems to work.
Any ideas would be greatly appreciated!
Thanks!
Why the complex
EXCEPT? Doesn’t this work?: