null值比较的问题
Xcrow 2005-08-15 07:54:04 set ansi_nulls off
select null as a, null as b into #tmp
select 1 from #tmp where null = null
select 1 from #tmp where a=null
select 1 from #tmp where b=null
select 1 from #tmp where a = b
select 1 from #tmp where a =a
select 1 from #tmp where a = isnull(a, null)
set ansi_nulls on
前三句将返回数据,说明条件成立。后三句不返回数据,为什么?如何才能让两个皆为null的表达式相等?