pgsql isnull
Jump to turn (6)
- User
pgsql isnull
- Assistant
The isnull function in PostgreSQL is a boolean function that returns true if the specified expression evaluates to null, and false otherwise.
Syntax: isnull(expression)
Example: SELECT isnull(NULL); -- Returns true
SELECT isnull('test'); -- Returns false
SELECT isnull(1 + NULL); -- Returns true
- User
如何 让 他null时 返回0
- Assistant
您可以使用COALESCE函数将NULL替换为0。COALESCE函数接受任意数量的参数,并返回第一个非NULL参数。如果所有参数都是NULL,则返回NULL。