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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #replace #null #sql
ADD COMMENT
Topic
Name
1+8 =