开发者

What type of join is this? [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

How does SELECT from two tables separated by a comma work? (SELECT * FROM T1, T2)

Here's some SQL:

SELECT * FROM t1,t2开发者_JAVA百科

What kind of join is that?

Thanks,

Jim


Cartesian product of the 2 tables...


It's a no join :)

Actually is known as a Cross join, or a Carthesian product of two tables.

This will return all the rows in the first table, joined with all the rows in the second table, so the returned number of rows will be a product of the numbers of rows of the first and the second table.

This syntax is great if you need to generate a large volume of data, as joining just 4 tables with 100 records each will yield 100.000.000 records, however, can be quite irritating if you do it by accident.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜