怎么查询空字段!!!!
大家帮帮忙!!!模糊查询的时候怎么查询空字段啊?用like‘%%’都不是出全部数据啊!!含有空字段的没出来哦1!! --------------------编程问答-------------------- 后面加 and 字段名 is null --------------------编程问答-------------------- where (name='' or name is null) --------------------编程问答--------------------
+ --------------------编程问答--------------------
where len(查询内容)>0
--------------------编程问答-------------------- --------------------编程问答-------------------- where (name='' or name is null)
+2 --------------------编程问答--------------------
+1 --------------------编程问答-------------------- <td colspan =4 align =left style="background-color: #ECECFF; font-size: large; font-weight: bold;">
板块列表
--------------------编程问答--------------------
+1 --------------------编程问答-------------------- where (name='' or name is null)
+3 --------------------编程问答-------------------- 用 or 。。。is null 的话 到时候当条 like‘%**%’时,空的也会出来!!!这样不行! --------------------编程问答-------------------- where len(name)=0
已经有兄弟给出这个方法了,我只是重复一下,以便引起楼主的参考。 --------------------编程问答-------------------- “” --------------------编程问答--------------------
+ 满足当前条件和 当前条件为空的
--------------------编程问答-------------------- where (name='' or name is null) --------------------编程问答-------------------- 你这么写 看看
select * from 表名 where 模糊字段名 like'%模糊字符%' or 模糊字段名 is null --------------------编程问答-------------------- isnull(字段,'')<>'' --------------------编程问答--------------------
同意 --------------------编程问答-------------------- where (name like '%%' or name is null)
补充:.NET技术 , ASP.NET