參考地址 :https://www.cnblogs.com/liyasong/p/sql_in_exists.html
直接上結論:查詢B表時結果集大適合使用select * from A where exist (select * from B where A.ID = B.ID)
查詢A表時結果集大適合使用select * from A where A.ID IN (select * from B where A.ID = B.ID)
參考地址 :https://www.cnblogs.com/liyasong/p/sql_in_exists.html
直接上結論:查詢B表時結果集大適合使用select * from A where exist (select * from B where A.ID = B.ID)
查詢A表時結果集大適合使用select * from A where A.ID IN (select * from B where A.ID = B.ID)