Anh ơi, có 2 cách join và dùng truy vấn con để lấy dữ liệu 2 bảng, vậy cách nào cho hiệu năng tốt hơn trong trường hợp nào ạ.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Cái này chắc tùy vào cách cài đặt optimizer của từng RDBMS, nhưng theo mình đọc thì thấy JOIN nhanh hơn trong hầu hết trường hợp. Ví dụ trong MySQL docs (https://dev.mysql.com/doc/refman/5.7/en/rewriting-subqueries.html) có đề cập: