table
field1 field2
a 1
b
c 3
e 4
f
I need to count field1 and not empty field2 with on query:
SELECT COUNT(field1) FROM table
+
SELECT COUNT(field2) FROM table WHERE field2 != ''
result should be 5 and 3 in one query.
Is it possible?
Easy as pie 🙂
Result:
If the empty values in the
field2column are''(empty strings) instead of actualNULL, you can try this: