CROSS JOIN
The CROSS JOIN is used to generate a paired combination of each row of the first table with each row of the second table. This join type is also known as cartesian join.
If WHERE clause is used with CROSS JOIN, it functions like an INNER JOIN.
The below code returns all combination Meals with all Drinks
CROSS JOIN - Popular snippets
- MS SQL Server 2017 CREATE TABLE MONTH INSERT INTO WITH SELECT CROSS JOIN COALESCE SUM ORDER BY LEFT JOIN
last run:
2023-12-09 08:16:08
104
- MySQL 5.7 CREATE TABLE MONTH INSERT INTO WITH SELECT CROSS JOIN COALESCE SUM ORDER BY LEFT JOIN
last run:
2024-09-09 09:57:54
31
- MySQL 8.0 CREATE TABLE NOT SELECT INSERT INTO WITH WHERE AND LEFT JOIN LAG ORDER BY GROUP BY LIKE COUNT CROSS JOIN LEAD IFNULL
last run:
2023-05-31 16:19:37
29
- Oracle Database 21c CREATE TABLE INSERT INTO SELECT ALTER TABLE UPDATE WHERE TRUNCATE DROP TABLE DELETE CREATE VIEW NOT PRIMARY KEY FOREIGN KEY INNER JOIN LEFT JOIN RIGHT CROSS JOIN
last run:
2023-05-31 16:17:04
27
- PostgreSQL 15 CREATE TABLE INSERT INTO SELECT CROSS JOIN GROUP BY
last run:
2023-05-12 01:22:40
16
- MS SQL Server 2017 CREATE TABLE INSERT INTO SELECT WHERE CROSS JOIN
last run:
2024-08-13 18:10:22
16
- PostgreSQL 12 WITH SELECT CROSS JOIN WHERE ORDER BY AND SUM INNER JOIN GROUP BY
last run:
2024-08-02 20:30:07
15
- PostgreSQL 14 WITH SELECT UPDATE DELETE UPPER CROSS JOIN GROUP BY
last run:
2024-02-17 02:58:35
15
- PostgreSQL 15 WITH SELECT CROSS JOIN
last run:
2024-05-19 18:13:15
13
- PostgreSQL 13 CREATE TABLE INSERT INTO DEFAULT SELECT COALESCE LEFT JOIN CROSS JOIN WHERE
last run:
2022-08-18 19:44:55
12
CROSS JOIN - New snippets
-
PostgreSQL 10 Bookings (ReadOnly) SELECT CROSS JOIN GROUP BY ORDER BY INNER JOIN
added at:
2024-09-09 09:37:40
1
-
PostgreSQL 10 Bookings (ReadOnly) SELECT CROSS JOIN GROUP BY ORDER BY INNER JOIN
added at:
2024-09-09 09:36:45
1
-
PostgreSQL 10 Bookings (ReadOnly) SELECT CROSS JOIN GROUP BY ORDER BY INNER JOIN
added at:
2024-09-09 09:35:22
1
-
PostgreSQL 10 Bookings (ReadOnly) SELECT CROSS JOIN GROUP BY ORDER BY INNER JOIN
added at:
2024-09-09 09:34:43
1
-
PostgreSQL 10 Bookings (ReadOnly) SELECT CROSS JOIN GROUP BY ORDER BY
added at:
2024-09-09 09:30:49
1
-
PostgreSQL 10 Bookings (ReadOnly) SELECT CROSS JOIN GROUP BY ORDER BY
added at:
2024-09-09 09:28:52
1
-
PostgreSQL 10 Bookings (ReadOnly) SELECT CROSS JOIN GROUP BY ORDER BY
added at:
2024-09-09 09:28:28
1
-
MySQL 8.0 Sakila (ReadOnly) SELECT CROSS JOIN WHERE IN OR ORDER BY SHOW LIKE
added at:
2024-09-07 18:54:27
1
-
MySQL 8.0 Sakila (ReadOnly) SELECT CROSS JOIN WHERE IN OR ORDER BY
added at:
2024-09-07 18:54:16
2
-
MySQL 8.0 Sakila (ReadOnly) SELECT CROSS JOIN WHERE IN ORDER BY
added at:
2024-09-07 18:43:54
1