日期:2014-05-17  浏览次数:20902 次

问个简单的SQL语句,在线等
select   *   from   travel   where   province= '辽宁 '   and   view= ' '

这样为什么读不出来?
我想读取view字段为空值的数据出来.

------解决方案--------------------
select * from travel where province= '辽宁 'and view Is Null 或者

select * from travel where province= '辽宁 ' and view= " "
------解决方案--------------------
select * from travel where province= '辽宁 'and (view Is Null or view= ' ')
------解决方案--------------------
select * from travel where province= '辽宁 ' and isnull(view, ' ')= ' '

或:
select * from travel where province= '辽宁 ' and rtrim(view)= ' '