Home > front end >  Postgres: How to find rows in which a specific column has 'empty' values?
Postgres: How to find rows in which a specific column has 'empty' values?

Time:12-07

I need to find rows which have a empty values in a column after a CSV import. The column is an INTEGER column, hence the

...
where col = ''

doesn't work for me.

CodePudding user response:

You can check for empty values using

where col is null

If you want to select null as 0 (or any other default value) use coalesce

select coalesce(max(col), 0)
  • Related