mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
28 lines
902 B
MySQL
28 lines
902 B
MySQL
|
DROP TABLE IF EXISTS join_test;
|
||
|
|
||
|
CREATE TABLE join_test (id UInt16, num UInt16) engine = Join(ANY, LEFT, id) settings join_any_take_last_row = 1;
|
||
|
|
||
|
INSERT INTO join_test (id, num) SELECT number, number FROM system.numbers LIMIT 1000;
|
||
|
|
||
|
SELECT joinGet('join_test', 'num', 500);
|
||
|
|
||
|
-- joinGet('join_test', 'num', 500) will be 500 and it is fine
|
||
|
-- replace all the values
|
||
|
|
||
|
INSERT INTO join_test (id, num) SELECT number, number * 2 FROM system.numbers LIMIT 1000;
|
||
|
|
||
|
SELECT joinGet ('join_test', 'num', 500);
|
||
|
|
||
|
-- joinGet('join_test', 'num', 500) will be 1000 and it is fine
|
||
|
|
||
|
TRUNCATE TABLE join_test;
|
||
|
|
||
|
INSERT INTO join_test (id, num) SELECT number, number FROM system.numbers LIMIT 1000;
|
||
|
|
||
|
INSERT INTO join_test (id, num) SELECT number, number * 2 FROM system.numbers LIMIT 1000;
|
||
|
|
||
|
SELECT joinGet('join_test', 'num', 500);
|
||
|
|
||
|
-- joinGet('join_test', 'num', 500) will be 1000 and it is not fine
|
||
|
DROP TABLE join_test;
|