读书人

mssql怎么查询某个字段为空

发布时间: 2013-12-19 00:33:34 作者: rapoo

mssql如何查询某个字段为空
表字段为 istitle varchar 类型的

我这样写查不出来东西 select top 3 * from qTcms_Comics where istitle !=''

istitle 字段里面确实什么都没有。 我查询出来的显示表结构。但是没数据。。。
[解决办法]
try this,


select top 3 *
from qTcms_Comics
where istitle='' or istitle is null or ltrim(rtrim(istitle))=''

[解决办法]
试试这个:
select top 3 * from qTcms_Comics 
where isnull(rtrim(ltrim(istitle)),'') !=''

读书人网 >SQL Server

热点推荐