PostgreSQL SyntaxLesson 35Free preview
PostgreSQL CROSS JOIN
This lesson is part of PostgreSQL · All levels
Summary
CROSS JOIN results in a Cartesian time result of any possible pair of rows from two tables without any join condition. The number of rows results is a multiple of the number of rows of the second table. In addition to writing CROSS JOIN, PostgreSQL also recognizes a comma style that implicitly does the same thing.
Key points
- Cross JOIN results in all combinations of the two-line pairs of tables.
- The number of rows resulting is equal to the multiplication of the number of rows in the second table.
- No need for an ON clause because it has no match conditions.
- It can be written in commas between tables without the word "cross".
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.