COALESCE funtion

COALESCE is one of the inbuilt function in  SQLServer.

I never seen people use this wonderful funtion

COALESCE usually retrives non null values specified in its arguments.

Select COALESCE(Column1,Column2) from Table_Name

we will get one column which compare with two columns and get non null column value.

Note:
  1.     Things you should remember NULL is not '0'
  2.      Before comparing convert all columns in same data type (Use CAST or Convert)

Read Users' Comments (0)

0 Response to "COALESCE funtion"

Post a Comment