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-12-19 07:47:24
36
- 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
- MS SQL Server 2017 CREATE TABLE INSERT INTO SELECT WHERE CROSS JOIN
last run:
2024-10-28 14:06:55
26
- PostgreSQL 15 CREATE TABLE INSERT INTO SELECT CROSS JOIN GROUP BY
last run:
2023-05-12 01:22:40
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
- MySQL 8.0 Sakila (ReadOnly) WITH SELECT COUNT SUM JOIN LEFT GROUP BY CROSS JOIN ORDER BY
last run:
2024-11-21 16:42:01
13
- PostgreSQL 10 Bookings (ReadOnly) WITH SELECT CROSS JOIN WHERE LEFT JOIN AND GROUP BY ORDER BY
last run:
2024-10-26 16:24:09
13
CROSS JOIN - New snippets
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN LEFT OUTER JOIN AND ROW_NUMBER ORDER BY SUM CASE GROUP BY
added at:
2024-12-20 10:44:13
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN LEFT OUTER JOIN AND ROW_NUMBER ORDER BY SUM CASE GROUP BY
added at:
2024-12-20 10:42:33
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN LEFT OUTER JOIN AND
added at:
2024-12-20 10:37:39
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN LEFT OUTER JOIN AND
added at:
2024-12-20 10:36:53
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN
added at:
2024-12-20 10:34:50
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN
added at:
2024-12-20 10:33:27
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN
added at:
2024-12-20 10:31:50
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN LEFT OUTER JOIN AND
added at:
2024-12-20 10:17:00
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN LEFT OUTER JOIN AND
added at:
2024-12-20 10:16:06
1
-
Oracle Database 19c (HR) WITH SELECT CROSS JOIN LEFT OUTER JOIN AND
added at:
2024-12-20 10:14:01
1