求助关于字段为NULL时的查询问题

zsl6658 2005-10-24 06:33:18
我有一个表:AAA,其中有个字段:ZY(摘要)现用如下查询语句:
  select a,b,c,zy from AAA where zy like 条件;
如果某一条记录的ZY字段不为NULL时,能够查询到此条记录,但是,如果某条记录的ZY字段为NULL时,这条记录就无法查询出来。请问该如何解决这个问题。
...全文
120 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wscft 2005-10-27
  • 打赏
  • 举报
回复
select a,b,c,zy from AAA where zy is null
shuyf2000 2005-10-27
  • 打赏
  • 举报
回复
select a,b,c,zy from AAA where isNull(zy ,'') like 条件
ribut9225 2005-10-27
  • 打赏
  • 举报
回复
select a,b,c,zy from AAA where zy is null; //查找zy为null的数据
danlov 2005-10-26
  • 打赏
  • 举报
回复
select a,b,c,zy from AAA where zy like 条件 and zy is not null;
lzheng2001 2005-10-24
  • 打赏
  • 举报
回复
select a,b,c,zy from AAA where zy like 条件 or zy is null

752

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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