Du kan bruge denne simple test:
WHERE (requires = 'privacy-weight' AND privacy-weight = 0) OR requires <> 'privacy-weight' OR requires IS NULL
Den første del (requires = 'privacy-weight' AND privacy-weight = 0)
forhindrer output af:
privacy-weight | requires
-------------------------
1 | privacy-weight
Men holder:
privacy-weight | requires
-------------------------
0 | privacy-weight
Mens den anden del OR requires <> 'privacy-weight' OR requires IS NULL
vil beholde følgende:
privacy-weight | requires
-------------------------
0 | NULL
1 | NULL
1 | NULL