mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-11 01:54:55 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
16 lines
608 B
SQL
16 lines
608 B
SQL
drop table if exists test_join;
|
|
|
|
create table test_join (date Date, id Int32, name Nullable(String)) engine = MergeTree partition by date order by id;
|
|
|
|
insert into test_join values ('2019-01-01', 1, 'a');
|
|
insert into test_join values ('2019-01-01', 2, 'b');
|
|
insert into test_join values ('2019-01-01', 3, 'c');
|
|
insert into test_join values ('2019-01-01', 1, null);
|
|
|
|
SELECT id, date, name FROM (SELECT id, date, name FROM test_join GROUP BY id, name, date) js1
|
|
FULL OUTER JOIN (SELECT id, date, name FROM test_join GROUP BY id, name, date) js2
|
|
USING (id, name, date)
|
|
ORDER BY id, name;
|
|
|
|
drop table test_join;
|