I have a query and at the end I want to leave out records where a certain two fields contain nulls at the same time
e.g.
开发者_运维问答and ((d.status is null AND b.actual is null)) < 1
so basically leave out the record if both of these fields have null at the same time.
I'd write this as:
...WHERE d.status IS NOT NULL OR b.actual IS NOT NULL
which, by DeMorgan's Laws, could also be written as:
...WHERE NOT(d.status IS NULL AND b.actual IS NULL)
精彩评论