您好我想知道哪種查詢適合多個表。Mysql查詢性能。哪一個最好?
對於如:
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
哪種查詢的是最好的表現嗎?
'從表1,table2'是被稱爲'哎呀意外的交叉join'反模式。 – Johan