I have a column that has numbers like this
p123
p139
d291
c9384
p393
null
null
c148
I want to compare this column where it says it includes only the p and null values. My code is:
WHERE (COLUMN NOT LIKE 'C%' AND COLUMN NOT LIKE 'D%' OR COLUMN IS NULL)
WHEN I have the condition COLUMN NOT LIKE 'C%' AND COLUMN NOT LIKE D% it comes back with out the null, but when I add the is null value, it comes back with one a c column even though there is a comparison to not include ones with c. I don't know how to get the order right or what parenthesis to use.
You could use a wildcard:
this would exclude any rows beginning with either
c
ord
. In your example the three rows starting withp
and the two rows withnull
would be returned.