select c.name,sup.name,s.name from client c,supplier sup,sellor s where c.id in (select o.clientId from t_order o where o.clientId=c.id and o.supplierId=sup.id and o.sellorId=s.id )
and (c.name='某某某' or sup.name='某某某' or s.name='某某某')
上面的语句为什么查不出结果呢?明明client这张表里面有这个名字为什么查询不出来?
and (c.name='某某某' or sup.name='某某某' or s.name='某某某')
上面的语句为什么查不出结果呢?明明client这张表里面有这个名字为什么查询不出来?
-- *(01) 你的where条件限制了
-- *(02) 数据表面上符合你的where条件要求,但实际却不符合你的where条件要求
-- (例如:字符类型数据前、后有空格)
select o.clientId from t_order o where o.clientId=c.id and o.supplierId=sup.id and o.sellorId=s.id )
and (c.name='某某某……
你没写FROM ****
MySQL 中文显示乱码