79597361

Date: 2025-04-28 22:35:57
Score: 1.5
Natty:
Report link

Seems like a lot of coding when generally speaking the best way to deal with the NULL values is in a where clause. What lingers in all of these solutions is the lack of a where clause. Remove the NULLS in the where clause and the count will work more naturally.

Select count(distinct field_value) where field_value is NOT NULL

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Stuart Segan