+ -
当前位置:首页 → 问答吧 → 查询一个text字段不为空或者不为null怎么写?

查询一个text字段不为空或者不为null怎么写?

时间:2010-09-24

来源:互联网

“select * from table where col is not null”   语句正确,但查询的结果col字段为空的也查询出来了。如果用“select * from table where col is not null and col<>'' ”执行时则提示:不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。困惑!!
我要的结果是查询出col字段(类型:text)确实有值的情形,排除空值或者null

作者: fhlch005414   发布时间: 2010-09-24

select * from table where (
(select count(col) from table) > 0
)

作者: lyl198659   发布时间: 2010-09-24

相关阅读 更多

热门下载

更多