summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/isolate_table_selects.sql
blob: 93c0f7c38385b43aecaf0e141e218c534ee7fb62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;

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