Saturday , November 23 2024

PostgreSQL Cross Join

In today’s article, we will explain the general use of PostgreSQL Cross Join with examples.

PostgreSQL Cross Join returns cartesian product of Tables. That is, it returns all rows of the right table against each row in the left table.

General usage:

For example :

If we write ‘on’ statement like INNER JOIN instead of ‘where’ condition of CROSS JOIN and do the synchronization, it will work like INNER JOIN.

When we run the script below, you will see that CROSS JOIN with WHERE added returns the same result as INNER JOIN.

Loading

About Faruk Erdem

Leave a Reply

Your email address will not be published. Required fields are marked *