declare @alive bit; set @alive = null; if @alive = 1 or @alive != 1 print 'Alive or Dead'; else print 'Huh? Neither alive nor dead'; if @alive=@alive PRINT 'It must equal itself, right?' ELSE PRINT 'Not always. null does not equal null';
代码挺有意思的,并且把NULL是什么解释的很清楚,写供大家参考一下。