//如果 check_expression 不为 NULL,那么返回该表达式的值;否则返回 replacement_value

ISNULL ( check_expression , replacement_value )

实例一 (用值 $10.00 替换 titles 表的 price 列中的所有 NULL 条目。)

USE pubs
GO
SELECT AVG(ISNULL(price, $10.00))
FROM titles
GO

 

实例二


USE pubs

GO
SELECT SUBSTRING(title, 115) AS Title, type AS Type,
ISNULL(price, 
0.00) AS Price
FROM titles
GO

相关文章:

  • 2021-12-02
  • 2021-11-13
  • 2021-11-20
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
猜你喜欢
  • 2021-09-02
  • 2021-11-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案