2

如何在 Postgres 中将空字符串与整数进行比较?

例如:Select * From xyz where anynumber = ''

4

1 回答 1

1

A numeric column can't be "blank", but it can be null. I think that's what you want:

Given that anynumber is nullable, ie

create table xyz (
    ...
    anynumber int,  -- ie not "NOT NULL"
    ...
)

You can test for null:

select * From xyz where anynumber is null
于 2013-02-26T13:19:07.900 回答