A SQL CROSS JOIN returns every possible combination of rows from two tables. Each row of the first table is paired with each row of the second, and there's no ON condition because nothing has to match. The result is called the Cartesian product of the two tables.
SELECT columns
FROM table_a
CROSS JOIN table_b;
The row count is always rows in A × rows in B. A table with 3 rows cross joined with a table of 4 rows gives 12 rows; 1,000 × 1,000 gives a million. CROSS JOIN works the same way in PostgreSQL, MySQL, SQL Server, SQLite, Oracle, Snowflake, BigQuery and every other mainstream database.
| You want | Use |
|---|---|
| Every combination of two lists (sizes × colors, players × players) | CROSS JOIN |
| A full grid (every store × every day) to show zeros for missing data | CROSS JOIN, then LEFT JOIN the facts |
| One value (like a grand total) attached to every row | CROSS JOIN a one-row subquery |
| Only rows that match on a key | INNER JOIN |
| All rows from one table, plus matches | LEFT JOIN |
| All rows from both tables, matched where possible | FULL OUTER JOIN |
| A subquery that runs once per row (top N per group) | CROSS JOIN LATERAL / CROSS APPLY |
Jump to: how it works · sample data · first example · comma syntax · when to use it · filling date gaps · generating dates · percent of total · self cross join · vs INNER JOIN · vs FULL OUTER JOIN · CROSS JOIN with ON · accidental cross joins · LATERAL and CROSS APPLY · database differences · performance · FAQ
What is a CROSS JOIN?
Every other join starts by asking "which rows go together?" and answers with an ON condition. A cross join skips the question: every row goes with every other row. If you picture the two tables as the rows and columns of a grid, a cross join fills in every cell.
That's also why it's sometimes called a Cartesian join, after the Cartesian product in math: the set of all ordered pairs (a, b) where a comes from one set and b from the other. Three rules follow from that:
- Row count is a multiplication.
|A| × |B|, always. No row is dropped and no row is unmatched. - If either table is empty, the result is empty. Anything times zero is zero. (We'll check this below.)
NULLs don't matter. Nothing is compared, so rows withNULLvalues are paired like any other row.
Sample data
The first examples use a tiny T-shirt shop: a list of colors and a list of sizes.
CREATE TABLE colors (name VARCHAR(20));
CREATE TABLE sizes (name VARCHAR(5), sort_order INT);
INSERT INTO colors VALUES ('Red'), ('Blue'), ('Black');
INSERT INTO sizes VALUES ('S', 1), ('M', 2), ('L', 3), ('XL', 4);
Later examples add three stores and their daily sales. Note the gaps: the Airport store sold nothing on 3 November, and the Mall only sold on the 3rd.
CREATE TABLE stores (id INT PRIMARY KEY, name VARCHAR(20));
CREATE TABLE sales (store_id INT, sale_date DATE, revenue INT);
CREATE TABLE days (day DATE);
INSERT INTO stores VALUES (1, 'Downtown'), (2, 'Airport'), (3, 'Mall');
INSERT INTO sales VALUES
(1, '2026-11-02', 420), (1, '2026-11-03', 380), (1, '2026-11-04', 510),
(2, '2026-11-02', 290), (2, '2026-11-04', 310),
(3, '2026-11-03', 150);
INSERT INTO days VALUES ('2026-11-02'), ('2026-11-03'), ('2026-11-04');
Every query in this guide was run on PostgreSQL 16, MySQL 8.0, SQL Server 2022 and SQLite 3.45, and the output shown is copied from those runs. Where the databases disagree, the differences are called out.
SQL CROSS JOIN example
To list every product variant the shop could sell, cross join colors with sizes:
SELECT c.name AS color, s.name AS size
FROM colors c
CROSS JOIN sizes s
ORDER BY c.name, s.sort_order;
color | size
-------+------
Black | S
Black | M
Black | L
Black | XL
Blue | S
Blue | M
Blue | L
Blue | XL
Red | S
Red | M
Red | L
Red | XL
(12 rows)
Three colors × four sizes = 12 rows, and all four databases return the same 12. Without the ORDER BY the order is up to the database, so sort explicitly when it matters. Here sort_order keeps S, M, L, XL in a sensible order instead of alphabetical (L, M, S, XL).
You can run the same idea in the free SQL Easy lessons, which execute SQL right in your browser. The self-join lesson has a rps table with Rock, Paper and Scissors; crossing it with itself lists every possible game:
The comma syntax: FROM a, b
Before JOIN keywords were added to SQL in 1992, you joined tables by listing them with commas. Listing two tables with no WHERE condition is a cross join:
SELECT c.name AS color, s.name AS size
FROM colors c, sizes s
ORDER BY c.name, s.sort_order;
This returns exactly the same 12 rows in every database. Both forms are standard and produce the same plan, but write CROSS JOIN on purpose. It tells the next reader "yes, I want every combination." A bare comma looks like someone forgot a WHERE clause, and very often that's exactly what happened.
When would you actually use a CROSS JOIN?
"What is a cross join actually used for?" is one of the most common SQL questions on Reddit. Most day-to-day queries never need one, but when you do, nothing else is as simple. The real uses fall into a few groups:
- Generating combinations. Product variants (color × size), test cases (browser × OS), schedules (employee × shift), tournament pairings (team × team).
- Building a complete grid for reports. Every store × every day, every product × every month, so periods with no sales show up as
0instead of disappearing. This is the most useful one by far. - Attaching a single value to every row. Cross join a one-row subquery (a grand total, today's date, a config setting) to use it in every row's calculation.
- Expanding rows. Cross join a numbers table to repeat each row N times, or cross join an array with
UNNESTto turn one row into one row per element.
Fill in missing dates with CROSS JOIN + LEFT JOIN
Here's the problem a cross join solves best. You want daily revenue per store for 2–4 November. The obvious query only returns the days each store actually sold something:
SELECT st.name AS store, sa.sale_date, sa.revenue
FROM stores st
LEFT JOIN sales sa ON sa.store_id = st.id
ORDER BY st.name, sa.sale_date;
store | sale_date | revenue
----------+------------+---------
Airport | 2026-11-02 | 290
Airport | 2026-11-04 | 310
Downtown | 2026-11-02 | 420
Downtown | 2026-11-03 | 380
Downtown | 2026-11-04 | 510
Mall | 2026-11-03 | 150
(6 rows)
Airport on the 3rd and Mall on the 2nd and 4th are simply missing. A chart built from this would draw a straight line across the gaps, and an average would skip the zero days. A LEFT JOIN can't help on its own, because there's no row anywhere that says "Mall, 2 November."
The fix is to build the grid first with a cross join (every store × every day), then LEFT JOIN the sales onto it and turn missing revenue into zero with COALESCE:
SELECT st.name AS store, d.day, COALESCE(SUM(sa.revenue), 0) AS revenue
FROM stores st
CROSS JOIN days d
LEFT JOIN sales sa ON sa.store_id = st.id AND sa.sale_date = d.day
GROUP BY st.name, d.day
ORDER BY st.name, d.day;
store | day | revenue
----------+------------+---------
Airport | 2026-11-02 | 290
Airport | 2026-11-03 | 0
Airport | 2026-11-04 | 310
Downtown | 2026-11-02 | 420
Downtown | 2026-11-03 | 380
Downtown | 2026-11-04 | 510
Mall | 2026-11-02 | 0
Mall | 2026-11-03 | 150
Mall | 2026-11-04 | 0
(9 rows)
Now there are exactly 3 stores × 3 days = 9 rows, with zeros in the gaps. Two details make this work:
- Both join conditions go in the
ONclause of theLEFT JOIN: the store and the date. Puttingsa.sale_date = d.dayin aWHEREclause instead would throw away the zero rows and you'd be back to six. (The LEFT JOIN guide explains this trap in detail.) - The
GROUP BYrolls up multiple sales on the same day. If your sales table has one row per day already, you can drop it and just useCOALESCE(sa.revenue, 0).
The same pattern works for product × month, employee × week or any "show me every combination, even the empty ones" report. It's also the standard way to build a dense input for a pivot or a running total, both of which give wrong answers when rows are missing.
Generate the date list instead of storing it
You rarely have a handy days table. Each database has a way to generate one on the fly, and you cross join that instead. Here's the 1–4 November grid in each.
PostgreSQL: generate_series
SELECT st.name AS store, d.day::date AS day, COALESCE(SUM(sa.revenue), 0) AS revenue
FROM stores st
CROSS JOIN generate_series(DATE '2026-11-01', DATE '2026-11-04', INTERVAL '1 day') AS d(day)
LEFT JOIN sales sa ON sa.store_id = st.id AND sa.sale_date = d.day
GROUP BY st.name, d.day
ORDER BY st.name, d.day;
store | day | revenue
----------+------------+---------
Airport | 2026-11-01 | 0
Airport | 2026-11-02 | 290
Airport | 2026-11-03 | 0
Airport | 2026-11-04 | 310
Downtown | 2026-11-01 | 0
Downtown | 2026-11-02 | 420
Downtown | 2026-11-03 | 380
Downtown | 2026-11-04 | 510
Mall | 2026-11-01 | 0
Mall | 2026-11-02 | 0
Mall | 2026-11-03 | 150
Mall | 2026-11-04 | 0
(12 rows)
MySQL 8 and SQLite: a recursive CTE
Neither has generate_series, so build the dates with a recursive CTE. Only the date arithmetic differs:
-- MySQL 8.0+
WITH RECURSIVE d(day) AS (
SELECT DATE '2026-11-01'
UNION ALL
SELECT day + INTERVAL 1 DAY FROM d WHERE day < DATE '2026-11-04'
)
SELECT st.name AS store, d.day, COALESCE(SUM(sa.revenue), 0) AS revenue
FROM stores st
CROSS JOIN d
LEFT JOIN sales sa ON sa.store_id = st.id AND sa.sale_date = d.day
GROUP BY st.name, d.day
ORDER BY st.name, d.day;
-- SQLite: replace the recursive step with
-- SELECT date(day, '+1 day') FROM d WHERE day < '2026-11-04'
-- and start from the text value '2026-11-01'
Both return the same 12 rows as PostgreSQL.
SQL Server 2022: GENERATE_SERIES
SQL Server 2022 added GENERATE_SERIES, but it only produces numbers, so add each number to a start date with DATEADD. Cast the start to date; with a plain string, DATEADD returns a datetime and every day shows up as 2026-11-01 00:00:00.000.
SELECT st.name AS store, d.day, COALESCE(SUM(sa.revenue), 0) AS revenue
FROM stores st
CROSS JOIN (
SELECT DATEADD(day, value, CAST('2026-11-01' AS date)) AS day
FROM GENERATE_SERIES(0, 3)
) AS d
LEFT JOIN sales sa ON sa.store_id = st.id AND sa.sale_date = d.day
GROUP BY st.name, d.day
ORDER BY st.name, d.day;
On older SQL Server versions (or databases at compatibility level below 160) use a recursive CTE, a numbers table or a calendar table instead. If you report by date a lot, a permanent calendar table is worth creating once.
Attach a total to every row: percent of total
A cross join with a subquery that returns exactly one row doesn't multiply anything; it just adds that row's columns to every row. That's a clean way to compute each store's share of total revenue:
SELECT st.name AS store,
SUM(sa.revenue) AS revenue,
ROUND(100.0 * SUM(sa.revenue) / t.total, 1) AS pct_of_total
FROM stores st
JOIN sales sa ON sa.store_id = st.id
CROSS JOIN (SELECT SUM(revenue) AS total FROM sales) t
GROUP BY st.name, t.total
ORDER BY revenue DESC;
store | revenue | pct_of_total
----------+---------+--------------
Downtown | 1310 | 63.6
Airport | 600 | 29.1
Mall | 150 | 7.3
(3 rows)
PostgreSQL, MySQL and SQLite show 63.6; SQL Server shows 63.600000000000 because of how it types the decimal (wrap it in CAST(... AS DECIMAL(5,1)) for a tidy result). Because t.total isn't aggregated, it has to appear in the GROUP BY. A window function, SUM(SUM(sa.revenue)) OVER (), does the same job, but the cross join version is easier to read for many people and works on old database versions too.
Cross join a table with itself
A self cross join pairs every row with every row of the same table, including itself. Use two aliases, exactly like a self join:
SELECT COUNT(*) AS n FROM stores a CROSS JOIN stores b; -- 9: 3 × 3
That includes pairs like (Downtown, Downtown) and both (Downtown, Mall) and (Mall, Downtown). For unique pairs, such as a round-robin schedule where each store plays every other store once, add a condition that keeps only one ordering:
SELECT a.name AS home, b.name AS away
FROM stores a
CROSS JOIN stores b
WHERE a.id < b.id
ORDER BY a.name, b.name;
home | away
----------+---------
Airport | Mall
Downtown | Airport
Downtown | Mall
(3 rows)
a.id < b.id removes self-pairs and keeps one of each mirrored pair, giving n × (n − 1) / 2 rows. Use a.id <> b.id instead if order matters (home and away games), which gives n × (n − 1).
CROSS JOIN vs INNER JOIN
An inner join is a cross join followed by a filter. Conceptually, the database pairs every row with every row and then keeps only the pairs where the ON condition is true. That means these two queries are the same:
SELECT COUNT(*) AS n FROM stores st CROSS JOIN sales sa WHERE sa.store_id = st.id; -- 6
SELECT COUNT(*) AS n FROM stores st INNER JOIN sales sa ON sa.store_id = st.id; -- 6
Both return 6 rows in all four databases, and PostgreSQL produces the identical plan for both:
QUERY PLAN
------------------------------------
Hash Join
Hash Cond: (sa.store_id = st.id)
-> Seq Scan on sales sa
-> Hash
-> Seq Scan on stores st
So a CROSS JOIN with a WHERE clause doesn't actually build the giant product first. The optimizer spots the join condition and runs a normal hash or merge join. Still, use INNER JOIN ... ON for this. It keeps the join logic next to the join and leaves WHERE for filtering.
CROSS JOIN | INNER JOIN | |
|---|---|---|
| Join condition | None | Required ON (or USING) |
| Rows returned | Always |A| × |B| | Only matching pairs (0 up to |A| × |B|) |
| On the sample data | 3 stores × 6 sales = 18 | 6 |
| Typical use | Combinations, grids, one-row lookups | Following a relationship (order → customer) |
| Query plan (no filter) | Nested loop over every pair | Hash, merge or index nested loop join |
CROSS JOIN vs FULL OUTER JOIN
These get mixed up because both are described as returning "all rows from both tables." They mean very different things:
- A FULL OUTER JOIN returns every row from each table once (or once per match), pairing rows where the
ONcondition is true and filling the rest withNULLs. - A CROSS JOIN returns every row from each table paired with every row from the other. No
NULLs are added and nothing is matched.
With 5 employees and 3 departments, a full outer join on department ID returns 6 rows, while a cross join returns 15. When the join key is unique, a full join returns at most |A| + |B| rows; a cross join always returns |A| × |B|.
And a cross join isn't a UNION either: UNION stacks rows from two queries (more rows, same columns), while CROSS JOIN combines them side by side (more rows and more columns).
Does CROSS JOIN need ON? Can you add one?
No, a cross join never needs ON. Whether you're allowed to add one depends on the database, and so does what happens when you write JOIN with no ON:
SELECT COUNT(*) AS n FROM stores st CROSS JOIN sales sa ON sa.store_id = st.id;
SELECT COUNT(*) AS n FROM stores st JOIN sales sa;
| Database | CROSS JOIN ... ON | JOIN / INNER JOIN without ON |
|---|---|---|
| PostgreSQL 16 | Error: syntax error at or near "ON" | Error: syntax error at or near ";" |
| SQL Server 2022 | Error: Incorrect syntax near the keyword 'ON' | Error: Incorrect syntax near ';' |
| MySQL 8.0 | Runs as an inner join: 6 rows | Runs as a cross join: 18 rows |
| SQLite 3.45 | Runs as an inner join: 6 rows | Runs as a cross join: 18 rows |
In MySQL, JOIN, INNER JOIN and CROSS JOIN are synonyms: the documentation says they're "syntactic equivalents." That's convenient, but it means a forgotten ON in MySQL or SQLite doesn't raise an error; it quietly returns a cross join. If a MySQL query suddenly returns far too many rows, check every JOIN for its ON clause. For portable SQL, write CROSS JOIN with no ON and INNER JOIN with one.
Accidental cross joins (and how to spot them)
Most cross joins in the wild are mistakes. They happen when a join condition is missing, and the symptoms are always the same: far more rows than expected, inflated totals, or a query that never finishes.
Missing WHERE in comma joins
SELECT COUNT(*) AS n FROM stores st, sales sa; -- 18, not 6
With old-style comma joins, the join condition lives in the WHERE clause, mixed in with the filters. Forget it (or delete the wrong line while editing) and every store is paired with every sale. Explicit JOIN ... ON syntax makes this much harder to do by accident.
Totals that are exactly N times too big
If an aggregate comes back as an exact multiple of the right answer, suspect a cross join:
SELECT SUM(sa.revenue) AS wrong_total FROM sales sa CROSS JOIN stores st; -- 6180
SELECT SUM(revenue) AS right_total FROM sales; -- 2060
6180 is exactly 3 × 2060, one copy of every sale per store. The same thing happens more subtly when a join condition matches on only part of a key (for example joining on product_id when the table is unique on product_id, month), producing a partial cross join. Compare COUNT(*) before and after each join to find where rows multiply.
Mixing commas and JOIN
This one produces a confusing error instead of wrong results:
SELECT st.name, d.day
FROM stores st, days d
JOIN sales sa ON sa.store_id = st.id;
- PostgreSQL:
ERROR: invalid reference to FROM-clause entry for table "st"with the hint "There is an entry for table "st", but it cannot be referenced from this part of the query." - MySQL:
ERROR 1054 (42S22): Unknown column 'st.id' in 'on clause' - SQL Server:
The multi-part identifier "st.id" could not be bound. - SQLite accepts it and runs it.
The cause is precedence: JOIN binds tighter than the comma, so the query is read as stores, (days JOIN sales ON ...), and st isn't visible inside the parentheses. Replace the comma with CROSS JOIN and the joins are evaluated left to right, so st is in scope.
CROSS JOIN LATERAL, CROSS APPLY and UNNEST
A normal cross join can't refer to the other table inside its subquery. LATERAL (PostgreSQL, MySQL 8.0.14+, Oracle, Snowflake) and CROSS APPLY (SQL Server, Oracle) lift that limit: the subquery runs once per row of the left table and can use its columns. That makes "top N per group" queries easy. Here's each store's best day:
-- PostgreSQL and MySQL 8.0.14+
SELECT st.name AS store, best.sale_date, best.revenue
FROM stores st
CROSS JOIN LATERAL (
SELECT sa.sale_date, sa.revenue
FROM sales sa
WHERE sa.store_id = st.id
ORDER BY sa.revenue DESC
LIMIT 1
) AS best
ORDER BY st.name;
-- SQL Server
SELECT st.name AS store, best.sale_date, best.revenue
FROM stores st
CROSS APPLY (
SELECT TOP 1 sa.sale_date, sa.revenue
FROM sales sa
WHERE sa.store_id = st.id
ORDER BY sa.revenue DESC
) AS best
ORDER BY st.name;
store | sale_date | revenue
----------+------------+---------
Airport | 2026-11-04 | 310
Downtown | 2026-11-04 | 510
Mall | 2026-11-03 | 150
(3 rows)
Despite the name, CROSS JOIN LATERAL behaves like an inner join: a store whose subquery returns no rows disappears from the result. To keep those rows, use LEFT JOIN LATERAL (...) ON true in PostgreSQL or OUTER APPLY in SQL Server. SQLite doesn't support LATERAL at all (you get near "SELECT": syntax error); use ROW_NUMBER() in a subquery instead, which works everywhere.
In PostgreSQL, BigQuery, Snowflake and DuckDB you'll also see CROSS JOIN UNNEST(...), which turns an array into one row per element:
SELECT p.name, tag
FROM (VALUES ('Mug', ARRAY['kitchen', 'gift']), ('Pen', ARRAY['office'])) AS p(name, tags)
CROSS JOIN unnest(p.tags) AS tag;
name | tag
------+---------
Mug | kitchen
Mug | gift
Pen | office
(3 rows)
Here the "cross join" is with a different list for each row, so Mug gets two rows and Pen gets one. Snowflake's equivalent is LATERAL FLATTEN(input => tags).
CROSS JOIN in MySQL, PostgreSQL, SQL Server, SQLite and Snowflake
The basic FROM a CROSS JOIN b is identical everywhere. The differences are at the edges:
| Database | CROSS JOIN | Allows ON | JOIN without ON | Per-row version | Date series |
|---|---|---|---|---|---|
| PostgreSQL | Yes | No (error) | Error | CROSS JOIN LATERAL | generate_series |
| MySQL 8 | Yes | Yes (acts as INNER) | Cross join | CROSS JOIN LATERAL (8.0.14+) | Recursive CTE |
| SQL Server | Yes | No (error) | Error | CROSS APPLY | GENERATE_SERIES (2022+) |
| SQLite | Yes | Yes (acts as INNER) | Cross join | None | Recursive CTE |
| Oracle | Yes | No | Error | CROSS APPLY, LATERAL | CONNECT BY LEVEL |
| Snowflake | Yes | No | Cross join | LATERAL, LATERAL FLATTEN | GENERATOR + SEQ4() |
One SQLite quirk is worth knowing: SQLite's query planner never reorders the tables on either side of the CROSS JOIN keyword, so CROSS JOIN doubles as a way to force join order. It treats a CROSS JOIN b ON ... as an inner join with a fixed order. The SQLite CROSS JOIN guide goes into more detail.
Is CROSS JOIN slow?
A cross join is exactly as slow as the number of rows it produces. Joining two 10-row lookup tables is instant. Joining two 100,000-row tables makes 10 billion rows, which no database will return quickly. There's no index that helps, because there's no condition to look up; PostgreSQL's plan for the colors × sizes query is a plain nested loop over every pair:
QUERY PLAN
--------------------------------
Nested Loop
-> Seq Scan on sizes
-> Materialize
-> Seq Scan on colors
Rules of thumb:
- Do the math first. Run
SELECT COUNT(*)on each side and multiply before running a cross join on real tables. - Keep at least one side small. The good uses (sizes, days in a month, a one-row total) all cross join with something tiny.
- Filter before you multiply. Cross join a filtered subquery or CTE (only this month's days, only active stores) rather than whole tables.
- Add the join condition if what you really want is matching rows; a cross join plus
WHEREworks, but anINNER JOINsays it more clearly.
Common CROSS JOIN mistakes
- Using a comma join and forgetting the
WHEREcondition. Write explicitJOIN ... ONso a missing condition is obvious. - Forgetting
ONin MySQL or SQLite.JOINwithoutONsilently becomes a cross join there instead of raising an error. - Putting the date match in
WHEREin a fill-the-gaps query. It removes the zero rows you built the grid to keep. Both conditions go in theLEFT JOIN'sON. - Aggregating after a cross join without noticing the multiplication. Totals come back as exact multiples of the real answer.
- Cross joining two large tables. Check the row counts first; the result size is their product.
- Expecting
CROSS JOIN LATERALto keep every left row. It drops rows whose subquery is empty. UseLEFT JOIN LATERAL ... ON trueorOUTER APPLY.
FAQ
What is a cross join in SQL?
A join that returns every combination of rows from two tables: each row of the first table paired with each row of the second. It has no join condition, and the number of rows returned is the product of the two tables' row counts.
What is a cross join example?
Combining a table of 3 colors with a table of 4 sizes using SELECT * FROM colors CROSS JOIN sizes gives all 12 color-and-size combinations, which is the full list of product variants.
Why do we use cross join?
To generate combinations (variants, schedules, pairings), to build a complete grid such as every store × every day so missing data shows up as zero, and to attach a single value like a grand total to every row.
Does a cross join need an ON clause?
No. A cross join has no condition. PostgreSQL and SQL Server reject CROSS JOIN ... ON with a syntax error; MySQL and SQLite accept it and run it as an inner join.
What is the difference between cross join and inner join?
A cross join returns all pairs of rows. An inner join returns only the pairs that satisfy its ON condition. An inner join is equivalent to a cross join filtered by that condition, and databases run both as the same plan.
What is the difference between cross join and full join?
A full outer join matches rows on a condition and keeps unmatched rows from both sides with NULLs, so each row appears roughly once. A cross join pairs every row with every other row, so the result is the product of the row counts.
Is a cross join the same as a Cartesian product?
Yes. The result of a cross join is the Cartesian product of the two tables. "Cartesian join" is another name for it.
Is FROM a, b the same as a cross join?
Yes, when there's no WHERE condition linking the tables. FROM a, b and FROM a CROSS JOIN b return the same rows. Adding WHERE a.id = b.a_id turns it into an inner join.
What happens if you cross join with an empty table?
You get zero rows, because anything multiplied by zero is zero. If you need rows from the first table even when the second is empty, use a LEFT JOIN ... ON 1 = 1 (or ON true in PostgreSQL) instead.
What is the difference between CROSS APPLY and CROSS JOIN?
CROSS JOIN combines two independent row sets. CROSS APPLY (SQL Server and Oracle) runs a subquery or table function once per row of the left table, and that subquery can use the left row's columns. The standard-SQL equivalent is CROSS JOIN LATERAL.
Practice joins
Cross joins make the most sense once regular joins feel natural. Work through the free interactive lessons on joins, left joins and self joins; they run in your browser with no signup, and the self-join lesson's rps table is a good place to try the Rock, Paper, Scissors example above. Then read the LEFT JOIN and FULL OUTER JOIN guides, try the join questions in the SQL practice problems, and keep the SQL cheat sheet handy for the syntax.