首页 > 代码库 > SQL判断如果一列值为null则取另一列值代替 isnull()

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

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

 

Define:

isnull(expression,replacement_value)

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