ClickHouse/tests/queries/0_stateless/02372_analyzer_join.reference
2022-10-24 10:22:19 +02:00

1555 lines
77 KiB
Plaintext

-- { echoOn }
SELECT 'JOIN INNER';
JOIN INNER
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value
FROM test_table_join_1 INNER JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1
SELECT '--';
--
SELECT t1.value, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
Join_1_Value_0 Join_2_Value_0
Join_1_Value_1 Join_2_Value_1
SELECT id FROM test_table_join_1 INNER JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT value FROM test_table_join_1 INNER JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON toString(t1.id) = toString(t2.id) AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id);
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1_id = t2_id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
SELECT 'JOIN LEFT';
JOIN LEFT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value
FROM test_table_join_1 LEFT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0
SELECT '--';
--
SELECT t1.value, t2.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
Join_1_Value_0 Join_2_Value_0
Join_1_Value_1 Join_2_Value_1
Join_1_Value_2
SELECT id FROM test_table_join_1 LEFT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT value FROM test_table_join_1 LEFT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 0
2 Join_1_Value_2 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 0
2 Join_1_Value_2 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON toString(t1.id) = toString(t2.id) AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 0
2 Join_1_Value_2 0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id);
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1_id = t2_id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
SELECT 'JOIN RIGHT';
JOIN RIGHT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value
FROM test_table_join_1 RIGHT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1
0 0 3 3 Join_2_Value_3 Join_2_Value_3
SELECT '--';
--
SELECT t1.value, t2.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
Join_1_Value_0 Join_2_Value_0
Join_1_Value_1 Join_2_Value_1
Join_2_Value_3
SELECT id FROM test_table_join_1 RIGHT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT value FROM test_table_join_1 RIGHT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
0 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
0 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON toString(t1.id) = toString(t2.id) AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
0 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id);
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1_id = t2_id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT 'JOIN FULL';
JOIN FULL
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value
FROM test_table_join_1 FULL JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0
0 0 3 3 Join_2_Value_3 Join_2_Value_3
SELECT '--';
--
SELECT t1.value, t2.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id;
Join_1_Value_0 Join_2_Value_0
Join_1_Value_1 Join_2_Value_1
Join_1_Value_2
Join_2_Value_3
SELECT id FROM test_table_join_1 FULL JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT value FROM test_table_join_1 FULL JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id; -- { serverError 207 }
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 0
2 Join_1_Value_2 0
0 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 0
2 Join_1_Value_2 0
0 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON toString(t1.id) = toString(t2.id) AND t1.value = 'Join_1_Value_0' AND t2.value = 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 0
2 Join_1_Value_2 0
0 1 Join_2_Value_1
0 3 Join_2_Value_3
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.id, t1.value, t2.id, t2.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
0 3 Join_2_Value_3
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id);
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
0 3 Join_2_Value_3
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1_id = t2_id;
0 Join_1_Value_0 0 Join_2_Value_0
1 Join_1_Value_1 1 Join_2_Value_1
2 Join_1_Value_2 0
0 3 Join_2_Value_3
SELECT 'First JOIN INNER second JOIN INNER';
First JOIN INNER second JOIN INNER
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 INNER JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
INNER JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1_id = t2_id
INNER JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT 'First JOIN INNER second JOIN LEFT';
First JOIN INNER second JOIN LEFT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 INNER JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
LEFT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1_id = t2_id
LEFT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT 'First JOIN INNER second JOIN RIGHT';
First JOIN INNER second JOIN RIGHT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 INNER JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1_id = t2_id
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'First JOIN INNER second JOIN FULL';
First JOIN INNER second JOIN FULL
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 INNER JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
INNER JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
FULL JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 ON t1_id = t2_id
FULL JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'First JOIN LEFT second JOIN INNER';
First JOIN LEFT second JOIN INNER
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 LEFT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
INNER JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
INNER JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT 'First JOIN LEFT second JOIN LEFT';
First JOIN LEFT second JOIN LEFT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 LEFT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
LEFT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
LEFT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT 'First JOIN LEFT second JOIN RIGHT';
First JOIN LEFT second JOIN RIGHT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 LEFT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT 'First JOIN LEFT second JOIN FULL';
First JOIN LEFT second JOIN FULL
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 LEFT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
LEFT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
FULL JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
FULL JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT 'First JOIN RIGHT second JOIN INNER';
First JOIN RIGHT second JOIN INNER
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 RIGHT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
INNER JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
INNER JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
SELECT 'First JOIN RIGHT second JOIN LEFT';
First JOIN RIGHT second JOIN LEFT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 RIGHT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
0 0 3 3 Join_2_Value_3 Join_2_Value_3 0 0
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_2_Value_3
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
0 1 Join_2_Value_1 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 1 Join_2_Value_1 0
0 3 Join_2_Value_3 0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_2_Value_3
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
LEFT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
LEFT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
SELECT 'First JOIN RIGHT second JOIN RIGHT';
First JOIN RIGHT second JOIN RIGHT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 RIGHT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'First JOIN RIGHT second JOIN FULL';
First JOIN RIGHT second JOIN FULL
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 RIGHT JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
0 0 3 3 Join_2_Value_3 Join_2_Value_3 0 0
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_2_Value_3
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
0 1 Join_2_Value_1 0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 1 Join_2_Value_1 0
0 3 Join_2_Value_3 0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
RIGHT JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_2_Value_3
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
FULL JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 ON t1_id = t2_id
FULL JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4
SELECT 'First JOIN FULL second JOIN INNER';
First JOIN FULL second JOIN INNER
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 FULL JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
INNER JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
INNER JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
INNER JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1_id = t2_id
INNER JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
SELECT 'First JOIN FULL second JOIN LEFT';
First JOIN FULL second JOIN LEFT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 FULL JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
0 0 3 3 Join_2_Value_3 Join_2_Value_3 0 0
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
LEFT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_2_Value_3
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
0 3 Join_2_Value_3 0
0 1 Join_2_Value_1 0
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
0 1 Join_2_Value_1 0
0 3 Join_2_Value_3 0
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
LEFT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_2_Value_3
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
LEFT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1_id = t2_id
LEFT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
SELECT 'First JOIN FULL second JOIN RIGHT';
First JOIN FULL second JOIN RIGHT
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 FULL JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
RIGHT JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
RIGHT JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1_id = t2_id
RIGHT JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 0 4 Join_3_Value_4
SELECT 'First JOIN FULL second JOIN FULL';
First JOIN FULL second JOIN FULL
SELECT 'JOIN ON without conditions';
JOIN ON without conditions
SELECT test_table_join_1.id, test_table_join_1.value, test_table_join_2.id, test_table_join_2.value, test_table_join_3.id, test_table_join_3.value
FROM test_table_join_1 FULL JOIN test_table_join_2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id, test_table_join_1.id, t1.value, test_table_join_1.value, t2.id, test_table_join_2.id, t2.value, test_table_join_2.value,
t3.id, test_table_join_3.id, t3.value, test_table_join_3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
0 0 Join_1_Value_0 Join_1_Value_0 0 0 Join_2_Value_0 Join_2_Value_0 0 0 Join_3_Value_0 Join_3_Value_0
1 1 Join_1_Value_1 Join_1_Value_1 1 1 Join_2_Value_1 Join_2_Value_1 1 1 Join_3_Value_1 Join_3_Value_1
2 2 Join_1_Value_2 Join_1_Value_2 0 0 0 0 Join_3_Value_0 Join_3_Value_0
0 0 3 3 Join_2_Value_3 Join_2_Value_3 0 0
0 0 0 0 4 4 Join_3_Value_4 Join_3_Value_4
SELECT '--';
--
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON test_table_join_1.id = test_table_join_2.id
FULL JOIN test_table_join_3 AS t3 ON test_table_join_2.id = test_table_join_3.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_2_Value_3
Join_3_Value_4
SELECT 'JOIN ON with conditions';
JOIN ON with conditions
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
0 3 Join_2_Value_3 0
0 1 Join_2_Value_1 0
0 0 4 Join_3_Value_4
0 0 1 Join_3_Value_1
SELECT '--';
--
SELECT t1.id, t1.value, t2.id, t2.value, t3.id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id AND t1.value == 'Join_1_Value_0' AND t2.value == 'Join_2_Value_0'
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id AND t2.value == 'Join_2_Value_0' AND t3.value == 'Join_3_Value_0';
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 0 0
2 Join_1_Value_2 0 0
0 1 Join_2_Value_1 0
0 3 Join_2_Value_3 0
0 0 1 Join_3_Value_1
0 0 4 Join_3_Value_4
SELECT 'JOIN multiple clauses';
JOIN multiple clauses
SELECT t1.value, t2.value, t3.value
FROM test_table_join_1 AS t1
FULL JOIN test_table_join_2 AS t2 ON t1.id = t2.id OR t1.id = t2.id
FULL JOIN test_table_join_3 AS t3 ON t2.id = t3.id OR t3.id = t2.id;
Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
Join_1_Value_2 Join_3_Value_0
Join_2_Value_3
Join_3_Value_4
SELECT 'JOIN expression aliases';
JOIN expression aliases
SELECT t1_id, t1.value, t2_id, t2.value, t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON (t1.id AS t1_id) = (t2.id AS t2_id)
FULL JOIN test_table_join_3 AS t3 ON t2_id = (t3.id AS t3_id);
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4
SELECT '--';
--
SELECT t1.id AS t1_id, t1.value, t2.id AS t2_id, t2.value, t3.id AS t3_id, t3.value
FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 ON t1_id = t2_id
FULL JOIN test_table_join_3 AS t3 ON t2_id = t3_id;
0 Join_1_Value_0 0 Join_2_Value_0 0 Join_3_Value_0
1 Join_1_Value_1 1 Join_2_Value_1 1 Join_3_Value_1
2 Join_1_Value_2 0 0 Join_3_Value_0
0 3 Join_2_Value_3 0
0 0 4 Join_3_Value_4