开发者

Joins using more than two tables

How to join one table开发者_运维知识库 with more than two tables?


This might be what you are looking for.

select * from Table1 a
join table2 b on (a.column = b.column)
join table3 c on (a.column = c.column)

But I suggest you pick up a tutorial on how to write queries to decrease downtime on basic statements.


SELECT * FROM a JOIN b JOIN c JOIN d

This will do a cartesian product because there is no join conditions, but a has been joined with three tables. Maybe your question needs to be more specific.


select * from table1 a,table2 b,table3 c where a.col=b.col and a.col=c.col
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜