2018-12-30 15:54:45 +00:00
|
|
|
DROP TABLE IF EXISTS kv;
|
|
|
|
|
|
|
|
CREATE TABLE kv (k UInt32, v UInt32) ENGINE Join(Any, Left, k);
|
|
|
|
INSERT INTO kv VALUES (1, 2);
|
|
|
|
INSERT INTO kv VALUES (1, 3);
|
|
|
|
SELECT joinGet('kv', 'v', toUInt32(1));
|
2019-01-24 17:12:05 +00:00
|
|
|
CREATE TABLE kv_overwrite (k UInt32, v UInt32) ENGINE Join(Any, Left, k) SETTINGS join_any_take_last_row = 1;
|
2018-12-30 15:54:45 +00:00
|
|
|
INSERT INTO kv_overwrite VALUES (1, 2);
|
|
|
|
INSERT INTO kv_overwrite VALUES (1, 3);
|
|
|
|
SELECT joinGet('kv_overwrite', 'v', toUInt32(1));
|
|
|
|
|
2024-06-28 11:58:10 +00:00
|
|
|
|
|
|
|
CREATE TABLE t2 (k UInt32, v UInt32) ENGINE = Memory;
|
|
|
|
INSERT INTO t2 VALUES (1, 2), (1, 3);
|
|
|
|
|
2024-07-12 12:49:26 +00:00
|
|
|
SET enable_analyzer = 1;
|
2024-06-28 11:58:10 +00:00
|
|
|
|
|
|
|
SELECT v FROM (SELECT 1 as k) t1 ANY INNER JOIN t2 USING (k) SETTINGS join_any_take_last_row = 0;
|
|
|
|
SELECT v FROM (SELECT 1 as k) t1 ANY INNER JOIN t2 USING (k) SETTINGS join_any_take_last_row = 1;
|
|
|
|
|
2018-12-30 15:54:45 +00:00
|
|
|
DROP TABLE kv;
|
|
|
|
DROP TABLE kv_overwrite;
|