SQL NULL Func

2019/10/21 database

# SQL NULL 函数

null 替换为某个值

# ISNULL()

  • SQL Server / MS Access
SELECT ISNULL(demo,0))
FROM demo

# NVL()

  • Oracle
SELECT NVL(demo,0))
FROM demo

# IFNULL()

  • Mysql
SELECT IFNULL(demo,0))
FROM demo

# COALESCE()

  • Mysql/Pgsql
SELECT COALESCE(demo,0))
FROM demo
上次更新: 6/6/2022, 3:18:29 PM