Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

psql count where not null

-- for default, count looks only the not null columns. 
-- so if searching a column, don't mind that
-- if you really want to make a condition, try the following:
select sum(
  case when a is not null then 1 else 0
)
from abc...
 
PREVIOUS NEXT
Tagged: #psql #count #null
ADD COMMENT
Topic
Name
6+5 =