Equivalence of CROSS JOIN and comma
От | Adam Mackler |
---|---|
Тема | Equivalence of CROSS JOIN and comma |
Дата | |
Msg-id | 20121015043935.GA37814@bk.macklerlaw.com обсуждение исходный текст |
Ответы |
Re: Equivalence of CROSS JOIN and comma
|
Список | pgsql-novice |
Hi: The PostgreSQL manual [1] reads in part: "FROM T1 CROSS JOIN T2 is equivalent to FROM T1, T2." Yet here are two statements that are identical to each other except that one has a CROSS JOIN where the other has a comma: WITH t1 (val) AS ( VALUES (1) ), t2 (name) AS ( VALUES ('foo') ), t3 (num) AS ( VALUES (1) ) SELECT * FROM t1 CROSS JOIN t2 JOIN t3 ON num=val; WITH t1 (val) AS ( VALUES (1) ), t2 (name) AS ( VALUES ('foo') ), t3 (num) AS ( VALUES (1) ) SELECT * FROM t1, t2 JOIN t3 ON num=val; and one works but the other doesn't. To my way of thinking, they are not equivalent, which makes me wonder if I am misunderstanding the quoted text above to mean that both statements should have the same result. What am I missing? I am using version 9.2.0. Thanks very munch in advance. [1] http://www.postgresql.org/docs/9.2/interactive/queries-table-expressions.html#QUERIES-JOIN -- Adam Mackler
В списке pgsql-novice по дате отправления: