您好,我想知道哪种查询适用于多个表。
例如:
select table1.id, table1.name from table1,table2,table3
where table1.id=table2.id and table2.id=table3.id
或
select table1.id, table1.name
from table1
inner join table2 on table1.id=table2.id
inner join table3 on table2.id=table3.id
where 1
或
select table1.id, table1.name
from table1
join table2 on table1.id=table2.id
join table3 on table2.id=table3.id
where 1
哪种查询最适合性能?
最佳答案
它们应该是完全一样的。可能您可能想阅读 corresponding section来自 MySQL 手册(然而,这仅与语法有关,与性能无关)。
关于Mysql 查询性能。哪个最好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7686190/