SELECT A.name,B.address FROM A INNER JOIN B ON A.id=B.A_id;
Equivalent to general connection
SELECT A.name,B.address FROM A,B WHERE A.id=B.A_id;
As above, the results of the two statements are the same, so what is the difference between the two statements? When to use internal connection. Instead of a normal connection? Please give me some advice. ~, that is more efficient? Which do we usually use most?
The function is the same. I am used to using the table connection method of the second WHERE sentence, which makes me feel better.
The performance of the test with 10,000 records was similar when the execution time and the EXPLAIN information were observed in phpMyAdmin inside.
For example, connect the three tables of student, score and course to query the information with student ID of 1:
/* WHERE words */ SELECT * FROM `student`, `score`, `course` WHERE `student`.`id` = `score`.`student_id` AND `score`.`course_id` = `course`.`id` AND `student`.`id` = 1; /* INNER JOIN ON */ SELECT * FROM `student` INNER JOIN `score` ON `student`.`id` = `score`.`student_id` INNER JOIN `course` ON `score`.`course_id` = `course`.`id` WHERE `student`.`id` = 1;