select * from b where b表字段 in (select a表字段 from a)其中in可根据需要用其他如like等替代
select * from b where id in (select id from a)