I have a table A
with column data:
mdr1222
-------
pprgd24
-------
invalid
-------
invalid
abc2345
I want to get a count of the invalid and blank(---). I tried :
SELECT count(data)
from A
where data = 'invalid' and null
but it doesn't work. Can someone please help me figure out what I am doing wrong here?
This should work as well.
SUM(CASE WHEN data IS NULL OR data = 'Invalid' THEN 1 ELSE 0 END)
FROM A
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With