- SELECT id, bid, name, title, publisher FROM A where publisher in (select publisher from B group by B.publisher)
或者
- SELECT id, bid, name, title, publisher FROM A where exists (select publisher from B where B.publisher = A.publisher group by B.publisher)
用EXISTS应该效率更高,另外对查询条件字段publisher建立索引。