Adam Mackler
2012-10-15 04:39:35 UTC
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
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
--
Sent via pgsql-novice mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
Adam Mackler
--
Sent via pgsql-novice mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice