summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/isolate_table_selects.sql
blob: 3b9a9388c58c948fb4b5b924a3b177edce980f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
SELECT * FROM x AS x, y AS y2;
SELECT * FROM (SELECT * FROM x AS x) AS x, (SELECT * FROM y AS y) AS y2;

SELECT * FROM x AS x WHERE x = 1;
SELECT * FROM x AS x WHERE x = 1;

SELECT * FROM x AS x JOIN y AS y;
SELECT * FROM (SELECT * FROM x AS x) AS x JOIN (SELECT * FROM y AS y) AS y;

SELECT * FROM (SELECT 1) AS x JOIN y AS y;
SELECT * FROM (SELECT 1) AS x JOIN (SELECT * FROM y AS y) AS y;

SELECT * FROM x AS x JOIN (SELECT * FROM y) AS y;
SELECT * FROM (SELECT * FROM x AS x) AS x JOIN (SELECT * FROM y) AS y;

WITH y AS (SELECT *) SELECT * FROM x AS x;
WITH y AS (SELECT *) SELECT * FROM x AS x;

WITH y AS (SELECT * FROM y AS y2 JOIN x AS z2) SELECT * FROM x AS x JOIN y as y;
WITH y AS (SELECT * FROM (SELECT * FROM y AS y) AS y2 JOIN (SELECT * FROM x AS x) AS z2) SELECT * FROM (SELECT * FROM x AS x) AS x JOIN y AS y;