Hi All,
Hope you all are doing good.
In this article, we will know about various ways of replacing NULL value.
Replace NULL value using ISNULL function()
Example: SELECT ISNULL(NULL,'No Employee') as Employee
Replace NULL value using CASE statement
Example:
Replace NULL value using COALESCE() function
SELECT COALESCE(NULL, 'No Employee') as Employee
Use of COALESCE() function
COALESCE() returns the first Non NULL value of a column in each row.
Example:
Keep reading!!
Enjoy!!
Hope you all are doing good.
In this article, we will know about various ways of replacing NULL value.
Replace NULL value using ISNULL function()
Example: SELECT ISNULL(NULL,'No Employee') as Employee
Replace NULL value using CASE statement
Example:
SELECT CASE | |
WHEN 'SUNEEL' IS NULL THEN | |
'No Employee' | |
ELSE | |
'Employee' | |
END as Employee |
Replace NULL value using COALESCE() function
SELECT COALESCE(NULL, 'No Employee') as Employee
Use of COALESCE() function
COALESCE() returns the first Non NULL value of a column in each row.
Example:
SELECT Id, COALESCE(FirstName, MiddleName, LastName) AS Name FROM tblCustomer |
Keep reading!!
Enjoy!!
No comments:
Post a Comment