错了。 select distinct a.id,a.f1 from master a,item b where a.id=b.id and b.qty>=101 and b.qty<=102或 select * from master where id in (select id from item where qty >=101 and qty <=102)
select distinct a.id,a.f1 from master a,item b where a.id=b.id and b.qty>=101 and b.qty<=102
select * from master where id in (select id from item where qty >=101 and qty <=102)
select distinct a.id,a.f1 from master a,item b where a.id=b.id and b.qty>=101 and
b.qty<=102或
select * from master where id in
(select id from item where qty >=101 and qty <=102)
from master
where id in
(select id
from item
where qty >=101 and qty <=102)
使用distinct是不合适的,原理不一样,只是结果在一定情况下是相同而已。