|
--先连接table4和table5并将其结果集命名为table2,再与table1连接
select table1.column,table2.column
from table1
inner join
( select table4.column,table5.column
from table4 inner join table5
on table4.column =table5.column ) as table2
on table1.column=table2.column;
等同于
select table1.column ,table2.column
from table1 ,(select table4.column,table5.column
from table4,table5
where table4.column=table5.column) as table2
where table1.column=table2.column;
--连接table1,table2,table3,没有连接顺序之分
select table1.column,table2.column,table3.column
from table1 inner join table2
on table1.column=table2.column
inner join table3
on table1.column=table3.column;
等同于
select table1.column,table2.column,table3.column
from table1,table2.table3
where table1.column=table2.column and table1.column=table3.column;
|
|
|