如何在 Postgres 中比较空字符串和整数?
例如: 选择 * From xyz where anynumber = ''
最佳答案
数字列不能为“空白”,但可以为null
。我想这就是你想要的:
鉴于 anynumber
可以为空,即
create table xyz (
...
anynumber int, -- ie not "NOT NULL"
...
)
您可以测试空值:
select * From xyz where anynumber is null
关于string - 如何比较字符串和整数 Postgres,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15089982/