有两张表 A,B,都有字段 id, 查询A表中所有的 A.id 在 B表中也存在的记录
3条回答 默认 最新
- 智_慧 2018-09-05 05:59关注
select * from A where id in (select id from B where id in (select id from A))
或者
select Aid from (
select A.id as Aid,B.id as Bid from A left join B on A.id=B.id
) as tmp where Bid is not null这样查询试一下看对不对吧
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 1无用