mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-09 07:52:19 +00:00
48 lines
2.0 KiB
Plaintext
48 lines
2.0 KiB
Plaintext
-- { echoOn }
|
|
|
|
SELECT * FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 USING (id) ORDER BY id, t1.value;
|
|
0 Join_1_Value_0 Join_2_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1
|
|
SELECT * FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 USING (id, id, id) ORDER BY id, t1.value; -- { serverError 36 }
|
|
SELECT '--';
|
|
--
|
|
SELECT * FROM test_table_join_1 AS t1 LEFT JOIN test_table_join_2 AS t2 USING (id) ORDER BY id, t1.value;
|
|
0 Join_1_Value_0 Join_2_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1
|
|
2 Join_1_Value_2
|
|
SELECT '--';
|
|
--
|
|
SELECT * FROM test_table_join_1 AS t1 RIGHT JOIN test_table_join_2 AS t2 USING (id) ORDER BY id, t1.value;
|
|
0 Join_1_Value_0 Join_2_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1
|
|
3 Join_2_Value_3
|
|
SELECT '--';
|
|
--
|
|
SELECT * FROM test_table_join_1 AS t1 FULL JOIN test_table_join_2 AS t2 USING (id) ORDER BY id, t1.value;
|
|
0 Join_2_Value_3
|
|
0 Join_1_Value_0 Join_2_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1
|
|
2 Join_1_Value_2
|
|
SELECT '--';
|
|
--
|
|
SELECT * FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 USING (id) INNER JOIN test_table_join_3 AS t3 USING (id) ORDER BY id, t1.value;
|
|
0 Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
|
|
SELECT '--';
|
|
--
|
|
SELECT * FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 USING (id) LEFT JOIN test_table_join_3 AS t3 USING (id) ORDER BY id, t1.value;
|
|
0 Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
|
|
SELECT '--';
|
|
--
|
|
SELECT * FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 USING (id) RIGHT JOIN test_table_join_3 AS t3 USING (id) ORDER BY id, t1.value;
|
|
0 Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
|
|
4 Join_3_Value_4
|
|
SELECT '--';
|
|
--
|
|
SELECT * FROM test_table_join_1 AS t1 INNER JOIN test_table_join_2 AS t2 USING (id) FULL JOIN test_table_join_3 AS t3 USING (id) ORDER BY id, t1.value;
|
|
0 Join_3_Value_4
|
|
0 Join_1_Value_0 Join_2_Value_0 Join_3_Value_0
|
|
1 Join_1_Value_1 Join_2_Value_1 Join_3_Value_1
|