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-11-26 16:00:46
35
- 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 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING SUBSTR CASE
added at:
2024-12-03 14:01:30
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING SUBSTR CASE
added at:
2024-12-03 11:20:03
2
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING SUBSTR CASE
added at:
2024-12-03 11:19:44
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING SUBSTR CASE
added at:
2024-12-03 11:18:50
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING SUBSTR
added at:
2024-12-03 11:16:23
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING LIKE
added at:
2024-12-03 11:01:46
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING
added at:
2024-12-03 11:00:12
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING
added at:
2024-12-03 09:03:58
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING
added at:
2024-12-03 09:01:56
1
-
Oracle Database 21c CREATE TABLE PRIMARY KEY INSERT INTO FOREIGN KEY SELECT WHERE AND IN NOT CREATE OR REPLACE VIEW INNER JOIN JOIN CROSS JOIN OUTER JOIN LEFT RIGHT SUM COUNT GROUP BY HAVING
added at:
2024-12-03 08:56:14
1