问题遇到的现象和发生背景
Mysql
问题相关代码,请勿粘贴截图
比如说表A存放许多查询图书的条件,表B存放图书馆全部书的信息,根据条件查询书的id,因为前端是图书馆管理系统,多条件查询,同时部分查询条件可以为空
select bid from a,b where( b.bname in (a.bname) or b.bname = "" ) and
(b.bauthor in (a.author) or b.bauthor = '''' )
第一个问题 b.bname = "" 作用是什么 ?
运行结果及报错内容
第二个问题,为什么这条查询语句没有实现 多条件查询,部分查询条件可以为空?
select bid from book a ,querybook b where ( b.bname in (a.bname) or b.bname = "" ) and
(b.bauthor in (a.bauthor) or b.bauthor = "" ) and
(b.barea in (a.barea) or b.barea = "" )