当前位置:网站首页>Clickhouse填坑记2:Join条件不支持大于、小于等非等式判断
Clickhouse填坑记2:Join条件不支持大于、小于等非等式判断
2022-07-28 04:54:00 【IT源哥】
最近遇到一个问题,ClickHouse中有一张表,里面有个用户(f_user)字段,每天都有统计数据,现在想取某一个的产生的新用户数据,因为用惯了MySQL,我很自然的想到同一张表做一个Join操作,然后前表的日期大于后表,where过滤条件中,后表的日期为null,这样就能取出数据,但最后发现ClickHouse并不支持这种操作,折腾了好久,最后终于搞定这个问题,这里详细描述一下过程。
- 问题描述
在MySQL中,往往可以用类似下面的写法:
Select a.f_date,count(a.f_user) from t_table a
left join t_table b on a.f_date>b.f_date and a.f_user=b.f_user
Where b.f_date is null
Group by a.f_date这个写法在MySQL很好用,但是在ClickHouse里面,就会报类似以下异常:
ClickHouse exception, code: 48, host: 128.0.0.1, port: 1166
边栏推荐
- 【Oracle】083错题集
- Test report don't step on the pit
- (manual) [sqli labs27, 27a] error echo, Boolean blind injection, filtered injection
- Tiantian AMADA CNC bending machine touch screen maintenance rgm21003 host circuit board maintenance
- Strlen introduction, and the difference between sizeof
- Have you learned the common SQL interview questions on the short video platform?
- 【sylar】框架篇-Chapter7-IO 协程调度模块
- 外卖系统 文件上传
- RT_ Use of thread mailbox
- linux下安装mysql
猜你喜欢

Array or object, date operation

Redis type
![[Oracle] 083 wrong question set](/img/10/9a5dae9542a8fed0356843c59f3c2f.png)
[Oracle] 083 wrong question set

Redux basic syntax

excel实战应用案例100讲(十一)-Excel插入图片小技巧

Special topic of APP performance design and Optimization - poor implementation affecting performance

What should testers know about login security?

Analysis of the reason why easycvr service can't be started and tips for dealing with easy disk space filling

Interview fraud: there are companies that make money from interviews

Inspire domestic students to learn robot programming education for children
随机推荐
塑料可以执行GB/T 2408 -燃烧性能的测定吗
Look at the experience of n-year software testing summarized by people who came over the test
动态sql和分页
【sylar】框架篇-Chapter12-ByteArray 模块
100 lectures on Excel practical application cases (XI) - tips for inserting pictures in Excel
[idea] check out master invalid path problem
吉利AI面试题【杭州多测师】【杭州多测师_王sir】
Alibaba interview question [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]
Redis configuration file explanation / parameter explanation and elimination strategy
Euler road / Euler circuit
[Sylar] framework chapter -chapter10-address module
What is the reason why the easycvr national standard protocol access equipment is online but the channel is not online?
flink思维导图
网络安全基本知识——密码(一)
How to quickly locate bugs? How to write test cases?
Program life | how to switch to software testing? (software testing learning roadmap attached)
【sylar】框架篇-Chapter11-Socket 模块
提升学生群体中的STEAM教育核心素养
Jupyter notebook installation code prompt function
Cmake usage base summary