2023-02-09 17:30:57 +00:00
|
|
|
SET allow_experimental_analyzer = 1;
|
|
|
|
|
2021-04-29 14:34:26 +00:00
|
|
|
DROP TABLE IF EXISTS t2;
|
2015-01-28 02:37:05 +00:00
|
|
|
|
2021-04-29 14:34:26 +00:00
|
|
|
CREATE TABLE t2 (k UInt64, s String) ENGINE = Join(ANY, LEFT, k);
|
2015-01-28 02:37:05 +00:00
|
|
|
|
2021-04-29 14:34:26 +00:00
|
|
|
INSERT INTO t2 VALUES (1, 'abc'), (2, 'def');
|
2022-09-19 08:51:21 +00:00
|
|
|
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k ORDER BY k;
|
2015-01-28 02:37:05 +00:00
|
|
|
|
2021-04-29 14:34:26 +00:00
|
|
|
INSERT INTO t2 VALUES (6, 'ghi');
|
2022-09-19 08:51:21 +00:00
|
|
|
SELECT k, s FROM (SELECT number AS k FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k ORDER BY k;
|
2015-01-28 02:37:05 +00:00
|
|
|
|
2022-09-19 17:24:17 +00:00
|
|
|
SELECT k, js1.s, t2.s FROM (SELECT number AS k, number as s FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k ORDER BY k;
|
2022-09-19 08:51:21 +00:00
|
|
|
SELECT k, t2.k, js1.s, t2.s FROM (SELECT number AS k, number as s FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 USING k ORDER BY k;
|
2021-05-10 14:56:12 +00:00
|
|
|
|
2022-09-19 08:51:21 +00:00
|
|
|
SELECT k, js1.s, t2.s FROM (SELECT toUInt64(number / 3) AS k, sum(number) as s FROM numbers(10) GROUP BY toUInt64(number / 3) WITH TOTALS) js1 ANY LEFT JOIN t2 USING k ORDER BY k;
|
2021-04-29 14:30:02 +00:00
|
|
|
|
2022-09-19 08:51:21 +00:00
|
|
|
SELECT k, js1.s, t2.s FROM (SELECT number AS k, number AS s FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 ON js1.k == t2.k ORDER BY k;
|
|
|
|
SELECT k, t2.k, js1.s, t2.s FROM (SELECT number AS k, number AS s FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 ON js1.k == t2.k ORDER BY k;
|
2021-04-29 14:30:02 +00:00
|
|
|
|
2023-02-09 17:30:57 +00:00
|
|
|
SELECT k, js1.s, t2.s FROM (SELECT number AS k, number AS s FROM system.numbers LIMIT 10) js1 ANY LEFT JOIN t2 ON js1.k == t2.k OR js1.s == t2.k ORDER BY k; -- { serverError 264 }
|
2021-08-09 15:58:41 +00:00
|
|
|
|
2021-04-29 14:34:26 +00:00
|
|
|
DROP TABLE t2;
|