Jump to content

Joining multiple table - table order


peterjc

Recommended Posts

Hi,

 

Example from mysql.com

 

SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id
  LEFT JOIN table3 ON table2.id=table3.id;

 

SELECT * FROM table1 LEFT JOIN table2 ON table2.id= table1.id

  LEFT JOIN table3 ON table2.id=table3.id;

 

 

So is it the same to write table1.id=table2.id or table2.id= table1.id

 

 

Another example:

 

SELECT * FROM table1 t1, table2 t2 WHERE t1.idtable1=t2.idtable1

 

SELECT * FROM table1 t1, table2 t2 WHERE t2.idtable1=t1.idtable1

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/256170-joining-multiple-table-table-order/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.