你后边写的那句不对,RID选出来根本不是B001和B002
前边的也不对,一个RID不可能同时和那两个相等
不过可以这样
select Rname,Rphone from R where Rid in (select Rid from RB where Bid in ('B001','B002') )
或者按照你那么写的
select Rname,Rphone from R where Rid in ( select Rid from RB where Bid='B001' ) or Rid in (select Rid from RB where Bid='B002')
把and换成or