[英]Postgres: How to find rows in which a specific column has 'empty' values?
I need to find rows which have a empty values in a column after a CSV import.我需要在 CSV 导入后的列中查找具有空值的行。 The column is an
INTEGER
column, hence the该列是
INTEGER
列,因此
...
where col = ''
doesn't work for me.对我不起作用。
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 null 设为 0(或任何其他默认值),请使用 coalesce
select coalesce(max(col), 0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.