日期:2014-05-17  浏览次数:20544 次

多个left join,好混乱,怎么理清呢?
一个查询语句,连接了很多个表,看着就头晕

select * from table_1 a 
left join table_2 b on a.id=b.id
left join table_3 c on b.id=c.id
left join table_4 d on c.id=d.id
left join table_5 e on d.id=e.id

像这样的查询,是从 table_1 开始处理数据,向后推呢?
还是从 table_5 开始处理数据,向前推呢?

小弟跪谢!

------解决方案--------------------
从左至右
------解决方案--------------------
a 和b先join,成为一个虚拟表VT1(名字任意),然后VT1 和 c join 成为第二个虚拟表VT2,以此类推