- class="parameter">join_column [, ...]).
- See below for the meaning. For CROSS JOIN,
- none of these clauses can appear.
+ class="parameter">join_column [, ...]),
+ or NATURAL. See below for the meaning.
In the absence of parentheses, JOINs nest
left-to-right. In any case JOIN binds more
tightly than the commas separating FROM-list items.
-
-
-
CROSS JOIN and INNER JOIN
- produce a simple Cartesian product, the same result as you get from
- listing the two tables at the top level of FROM,
- but restricted by the join condition (if any).
- CROSS JOIN is equivalent to INNER JOIN ON
- (TRUE), that is, no rows are removed by qualification.
- These join types are just a notational convenience, since they
- do nothing you couldn't do with plain FROM and
- WHERE.
+ All the JOIN options are just a notational
+ convenience, since they do nothing you couldn't do with plain
+ FROM and WHERE.
LEFT OUTER JOIN returns all rows in the qualified
+
+ CROSS JOIN
+
+ CROSS JOIN is equivalent to INNER JOIN ON
+ (TRUE), that is, no rows are removed by qualification.
+ They produce a simple Cartesian product, the same result as you get from
+ listing the two tables at the top level of FROM,
+ but restricted by the join condition (if any).
+
+
+
+
LATERAL
SELECT f.title, f.did, d.name, f.date_prod, f.kind
- FROM distributors d, films f
- WHERE f.did = d.did
+ FROM distributors d JOIN films f USING (did);
title | did | name | date_prod | kind
-------------------+-----+--------------+------------+----------