mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 20:42:04 +00:00
96 lines
1.9 KiB
Plaintext
96 lines
1.9 KiB
Plaintext
-- { echoOn }
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b < t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 2
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b <= t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 1
|
|
1 2 1 2
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b > t2.b ORDER BY t1.b;
|
|
1 2 1 1
|
|
1 3 1 2
|
|
1 4 1 2
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b >= t2.b ORDER BY t1.b;
|
|
1 1 1 1
|
|
1 2 1 2
|
|
1 3 1 2
|
|
1 4 1 2
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 2
|
|
1 2 0 \N
|
|
1 3 0 \N
|
|
1 4 0 \N
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b <= t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 1
|
|
1 2 1 2
|
|
1 3 0 \N
|
|
1 4 0 \N
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b ORDER BY t1.b;
|
|
1 -1 0 \N
|
|
1 0 0 \N
|
|
1 1 0 \N
|
|
1 2 1 1
|
|
1 3 1 2
|
|
1 4 1 2
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b >= t2.b ORDER BY t1.b;
|
|
1 -1 0 \N
|
|
1 0 0 \N
|
|
1 1 1 1
|
|
1 2 1 2
|
|
1 3 1 2
|
|
1 4 1 2
|
|
SET join_use_nulls = 1;
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b < t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 2
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b <= t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 1
|
|
1 2 1 2
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b > t2.b ORDER BY t1.b;
|
|
1 2 1 1
|
|
1 3 1 2
|
|
1 4 1 2
|
|
SELECT * FROM t1 ASOF JOIN t2 ON t1.a = t2.a AND t1.b >= t2.b ORDER BY t1.b;
|
|
1 1 1 1
|
|
1 2 1 2
|
|
1 3 1 2
|
|
1 4 1 2
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 2
|
|
1 2 \N \N
|
|
1 3 \N \N
|
|
1 4 \N \N
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b <= t2.b ORDER BY t1.b;
|
|
1 -1 1 1
|
|
1 0 1 1
|
|
1 1 1 1
|
|
1 2 1 2
|
|
1 3 \N \N
|
|
1 4 \N \N
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b ORDER BY t1.b;
|
|
1 -1 \N \N
|
|
1 0 \N \N
|
|
1 1 \N \N
|
|
1 2 1 1
|
|
1 3 1 2
|
|
1 4 1 2
|
|
SELECT * FROM t1 ASOF LEFT JOIN t2 ON t1.a = t2.a AND t1.b >= t2.b ORDER BY t1.b;
|
|
1 -1 \N \N
|
|
1 0 \N \N
|
|
1 1 1 1
|
|
1 2 1 2
|
|
1 3 1 2
|
|
1 4 1 2
|
|
DROP TABLE t1;
|