给出两个表,A和B,A和B表的数据量, 当A小于B时,用exists select * from A where exists (select * from B where A.id=B.id) exists的实现,相当于外表循环,每次循环对内表进行查询? for i in A for j in B if j.id == i.id then .... 相反,如果A大于B的时候,则用in select * from A where id in (select id from B) 这种在逻辑上类似…