In SQL NULL plus anything equals NULL
Ex:
Alternate solutions
Ex:
SELECT MyColumn + 100
In the above case if mycolumn is null then the result is NULL
Alternate solutions
SELECT
CASE WHEN MyColumn IS NULL
THEN 0
ELSE MyColumn END
FROM MyTable
SELECT ISNULL(mycolumn, 0) + 100
FROM MyTable
No comments:
Post a Comment