Add a test for #18937 (#47738)

This commit is contained in:
Alexey Milovidov 2023-03-23 17:50:56 +03:00 committed by GitHub
parent 72c6084267
commit 4fcc5bbea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,2 @@
2021-01-01 上海市 启用
2021-01-02 北京市 停用

View File

@ -0,0 +1,24 @@
DROP TABLE IF EXISTS store;
DROP TABLE IF EXISTS location;
DROP TABLE IF EXISTS sales;
CREATE TABLE store (id UInt32, "名称" String, "状态" String) ENGINE=MergeTree() Order by id;
CREATE TABLE location (id UInt32, name String) ENGINE=MergeTree() Order by id;
CREATE TABLE sales ("日期" Date, "店铺" UInt32, "地址" UInt32, "销售额" Float32) ENGINE=MergeTree() Order by "日期";
INSERT INTO store VALUES (1,'店铺1','启用'),(2,'店铺2','停用');
INSERT INTO location VALUES (1,'上海市'),(2,'北京市');
INSERT INTO sales VALUES ('2021-01-01',1,1,10),('2021-01-02',2,2,20);
SELECT
``,
location.name,
store.``
FROM sales
LEFT JOIN store ON store.id = ``
LEFT JOIN location ON location.id = ``
ORDER BY 1, 2, 3;
DROP TABLE store;
DROP TABLE location;
DROP TABLE sales;