Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

case null SQL Server 2008

How to check for null in case statement in SQL Server 2008

like image 232
Rauf Avatar asked Dec 29 '10 07:12

Rauf


2 Answers

CASE WHEN column IS NULL THEN 1 ELSE 0 END
like image 197
Mitch Wheat Avatar answered Oct 07 '22 21:10

Mitch Wheat


Sometime you need case isnull(column, 99) when 99 then "null" when 1 then ....

like image 30
pinichi Avatar answered Oct 07 '22 22:10

pinichi