Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

replace null in sql

CASE WHEN ColumnName IS NULL THEN 'anyText' 
ELSE ColumnName END 
---------EXAMPLE --------------------------
SELECT E.Name as Employee, CASE WHEN M.Name IS NULL THEN 'No Manager' 
   ELSE M.Name END as Manager
FROM  tblEmployee E
LEFT JOIN tblEmployee M
ON   E.ManagerID = M.EmployeeID
 
PREVIOUS NEXT
Tagged: #replace #null #sql
ADD COMMENT
Topic
Name
1+2 =