您的位置:首页 > 博客中心 > 数据库 >

SQL判断如果一列值为null则取另一列值代替 isnull()

时间:2022-03-14 02:56

SELECT TOP 1000 [chClientCode]
      ,[nvcClientName]
      ,[chRegionCode]
      ,isnull(chUltimateHeadClientCode,[chClientCode]) as chUltimateHeadClientCode
  FROM [PwCMDM_V1].[Core].[tblClient]

 

Define:

isnull(expression,replacement_value)

热门排行

今日推荐

热门手游