mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
20 lines
524 B
SQL
20 lines
524 B
SQL
USE test;
|
|
|
|
DROP TABLE IF EXISTS table1;
|
|
DROP TABLE IF EXISTS table2;
|
|
CREATE TABLE table1 ( id String ) ENGINE = Log;
|
|
CREATE TABLE table2 ( parent_id String ) ENGINE = Log;
|
|
|
|
insert into table1 values ('1');
|
|
|
|
SELECT table2.parent_id = '', isNull(table2.parent_id)
|
|
FROM table1 ANY LEFT JOIN table2 ON table1.id = table2.parent_id;
|
|
|
|
SET join_use_nulls = 1;
|
|
|
|
SELECT table2.parent_id = '', isNull(table2.parent_id)
|
|
FROM table1 ANY LEFT JOIN table2 ON table1.id = table2.parent_id;
|
|
|
|
DROP TABLE test.table1;
|
|
DROP TABLE test.table2;
|