select b.* from b表 b where exists(select 1 from a表 where 关键字=关键字)
第一种方法 select b.* from b表 b where exists(select 1 from a表 where 关键字=b.关键字)第二种方法: select b.* from b表 b where 主键 in(select 主键 from a表) 第三种:如果没有主键 select b.* from b表 b where (列1+列2+列3+列4) in(select (列1+列2+列3+列4) from a表)
where exists(select 1 from a表 where 关键字=关键字)
select b.* from b表 b
where exists(select 1 from a表 where 关键字=b.关键字)第二种方法:
select b.* from b表 b
where 主键 in(select 主键 from a表)
第三种:如果没有主键
select b.* from b表 b
where (列1+列2+列3+列4) in(select (列1+列2+列3+列4) from a表)