Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第九章 JOIN 查询 9.5.1 ASOF 连接精度的问题 #39

Open
LeoWuxg opened this issue Nov 19, 2020 · 1 comment
Open

第九章 JOIN 查询 9.5.1 ASOF 连接精度的问题 #39

LeoWuxg opened this issue Nov 19, 2020 · 1 comment

Comments

@LeoWuxg
Copy link

LeoWuxg commented Nov 19, 2020

ASOF SQL示例:
SELECT a.id, a.name, b.rate, a.time, b.time FROM join_tb1 AS a ASOF INNER JOIN join_tb2 AS b ON a.id = b.id AND a.time = b.time
该SQL 执行失败:(SQL工具 DBeaver)
SQL 错误 [403]: ClickHouse exception, code: 403, host: 10.202.249.105, port: 8123; Code: 403, e.displayText() = DB::Exception: No inequality in ASOF JOIN ON section. (version 20.4.4.18 (official build))

书中表述:
而紧随其后的 a.time = b.time 则是 asof_column模糊连接条件,这条语句的语义等同于:
a.id = b.id AND a.time >= b.time.

我觉的好像不是这样,将 最上面的SQL中 a.time = b.time 替换为 a.time >= b.time 则能执行成功。
说明 a.time = b.time 在语义上不等于 a.time >= b.time
是由于 ClickHouse 版本升级的原因吗

@movingheart
Copy link

还有个地方有问题,184页的“代码清单9-2”里没有rate=105的记录,在185页怎么可能联结产生rate=105的记录呢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants