2020-02-05 13:51:41 +00:00
|
|
|
DROP TABLE IF EXISTS test_joinGet;
|
|
|
|
|
2020-07-11 07:12:42 +00:00
|
|
|
CREATE TABLE test_joinGet(user_id Nullable(Int32), name String) Engine = Join(ANY, LEFT, user_id);
|
2020-02-05 13:51:41 +00:00
|
|
|
|
2020-07-11 07:12:42 +00:00
|
|
|
INSERT INTO test_joinGet VALUES (2, 'a'), (6, 'b'), (10, 'c'), (null, 'd');
|
2020-02-05 13:51:41 +00:00
|
|
|
|
2020-07-11 07:12:42 +00:00
|
|
|
SELECT toNullable(toInt32(2)) user_id WHERE joinGet(test_joinGet, 'name', user_id) != '';
|
|
|
|
|
|
|
|
-- If the JOIN keys are Nullable fields, the rows where at least one of the keys has the value NULL are not joined.
|
|
|
|
SELECT cast(null AS Nullable(Int32)) user_id WHERE joinGet(test_joinGet, 'name', user_id) != '';
|
2020-02-05 13:51:41 +00:00
|
|
|
|
|
|
|
DROP TABLE test_joinGet;
|