1.select * from A where id in(select id from B);in适合B表比A表数据小的情况
2.select a.* from A a where exists(select 1 from B b where a.id=b.id);exists适合B表比A表数据大的情况
时间: 2024-10-21 08:47:42
1.select * from A where id in(select id from B);in适合B表比A表数据小的情况
2.select a.* from A a where exists(select 1 from B b where a.id=b.id);exists适合B表比A表数据大的情况