Posted by othellomy on 03/20/07 06:28
create table t1(c1 int, c2 varchar(10))
insert t1 values(1,'Hello')
insert t1 values(2,'')
insert t1 values(3,NULL)
select *
from t1
c1 c2
1 Hello
2
3 NULL
select *
from t1
where c2 = ' '
c1 c2
2
select *
from t1
where ltrim(rtrim(c2)) is null
c1 c2
3 NULL
The last query should have result as following. However sql server
2000 does no list row c1 = 2.
c1 c2
2
3 NULL
[Back to original message]
|