怎么查询空字段!!!!

jkandwhy 2011-04-21 12:32:01
大家帮帮忙!!!模糊查询的时候怎么查询空字段啊?
用like‘%%’都不是出全部数据啊!!含有空字段的没出来哦1!!
...全文
201 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
Adechen 2011-04-21
  • 打赏
  • 举报
回复
where (name='' or name is null)
+2
yksyuan 2011-04-21
  • 打赏
  • 举报
回复

where len(查询内容)>0

q107770540 2011-04-21
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 qq346127416 的回复:]

where (name='' or name is null)
[/Quote]
+
qq346127416 2011-04-21
  • 打赏
  • 举报
回复
where (name='' or name is null)
moonwrite 2011-04-21
  • 打赏
  • 举报
回复
后面加 and 字段名 is null
wang_pei_1984 2011-04-21
  • 打赏
  • 举报
回复
where (name like '%%' or name is null)
Cool_xiaocao 2011-04-21
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 qq346127416 的回复:]

where (name='' or name is null)
[/Quote]

同意
Comeonzhou 2011-04-21
  • 打赏
  • 举报
回复
isnull(字段,'')<>''
qq623932737 2011-04-21
  • 打赏
  • 举报
回复
你这么写 看看
select * from 表名 where 模糊字段名 like'%模糊字符%' or 模糊字段名 is null
L_justing 2011-04-21
  • 打赏
  • 举报
回复
where (name='' or name is null)
ycproc 2011-04-21
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 qq346127416 的回复:]

where (name='' or name is null)
[/Quote]
+ 满足当前条件和 当前条件为空的
IT0329 2011-04-21
  • 打赏
  • 举报
回复
“”
laolaolai 2011-04-21
  • 打赏
  • 举报
回复
where len(name)=0

已经有兄弟给出这个方法了,我只是重复一下,以便引起楼主的参考。
jkandwhy 2011-04-21
  • 打赏
  • 举报
回复
用 or 。。。is null 的话 到时候当条 like‘%**%’时,空的也会出来!!!这样不行!
wtj2832 2011-04-21
  • 打赏
  • 举报
回复
where (name='' or name is null)
+3
mfr496265873 2011-04-21
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 mfr496265873 的回复:]
<td colspan =4 align =left style="background-color: #ECECFF; font-size: large; font-weight: bold;">

&nbsp;&nbsp;&nbsp;&nbsp;板块列表
[/Quote]
+1
mfr496265873 2011-04-21
  • 打赏
  • 举报
回复
<td colspan =4 align =left style="background-color: #ECECFF; font-size: large; font-weight: bold;">

    板块列表
laolaolai 2011-04-21
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 yksyuan 的回复:]
SQL code

where len(查询内容)>0
[/Quote]
+1

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧