2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS a1;
|
|
|
|
DROP TABLE IF EXISTS a2;
|
2018-10-02 18:14:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE a1(a UInt8, b UInt8) ENGINE=Memory;
|
|
|
|
CREATE TABLE a2(a UInt8, b UInt8) ENGINE=Memory;
|
2018-10-02 18:14:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO a1 VALUES (1, 1), (1, 2), (2, 3);
|
|
|
|
INSERT INTO a2 VALUES (1, 2), (1, 3), (1, 4);
|
2018-10-02 18:14:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT * FROM a1 as a left JOIN a2 as b on a.a=b.a ORDER BY b SETTINGS join_default_strictness='ANY';
|
2019-01-29 12:38:53 +00:00
|
|
|
SELECT '-';
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT a1.*, a2.* FROM a1 ANY LEFT JOIN a2 USING a ORDER BY b;
|
2018-10-02 18:14:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS a1;
|
|
|
|
DROP TABLE IF EXISTS a2;
|