sql语句里面怎样判断数据类型为字符型的字段为空?

select top 1 * from news where n_titleimege<>'' and n_ncid=9 order by n_top asc,n_id desc
这样写就可以!
select top 1 * from news where n_ncid=9 and n_titleimege<>''order by n_top asc,n_id desc
这样就不行、是为什么呢?!

第1个回答  2008-03-29
select * from 表名 where 要查的字段 is null
执行这条语句看返回的行数就知道了
第2个回答  2008-03-29
要判断的值 is null
要判断的值 is not null
第3个回答  2008-03-29
null是空值,空值只能是非主属性.
第4个回答  2008-03-29
一般都是is null或者is not null
只有sqlserver可以用=null来判断本回答被提问者采纳
第5个回答  2008-03-29
就是字段名=null吧?
相似回答
大家正在搜