小编Mic*_*ael的帖子

Postgres 将空字符串转换为 NULL

我运行 Postgres 数据库并希望将空字符串转换为NULL。以下片段应该对所有列执行此操作,但它不起作用。

SELECT * FROM schema.table NULLIF(columnname,'');
Run Code Online (Sandbox Code Playgroud)

错误信息是:

ERROR:  syntax error at or near "''"
LINE 2:  NULLIF(columnname,'');
Run Code Online (Sandbox Code Playgroud)

sql postgresql null ifnull postgresql-10

3
推荐指数
1
解决办法
6291
查看次数

标签 统计

ifnull ×1

null ×1

postgresql ×1

postgresql-10 ×1

sql ×1