惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
量子位
博客园_首页
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Forbes - Security
Forbes - Security
IT之家
IT之家
N
News and Events Feed by Topic
S
Security Affairs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Webroot Blog
Webroot Blog
Recorded Future
Recorded Future
L
LangChain Blog
Y
Y Combinator Blog
AI
AI
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Know Your Adversary
Know Your Adversary
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google Online Security Blog
Google Online Security Blog
V2EX - 技术
V2EX - 技术
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
PCI Perspectives
PCI Perspectives
I
Intezer
T
Tenable Blog
G
Google Developers Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
有赞技术团队
有赞技术团队
O
OpenAI News
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
C
Check Point Blog
Last Week in AI
Last Week in AI
S
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
Blog — PlanetScale
Blog — PlanetScale

博客园 - koushr

hls k8s常用命令 k8s 1.18.0安装 mysql json函数 group by的列、where的列的有效性 go基础第六篇:sync包 es es语法 veo ride nacos 枫叶互动 极光矩阵 富途 移卡科技 nginx高可用 k8s第一篇:k8s集群架构组件 架构设计第二篇:支付模块架构设计 可观测性体系设计第一篇:可观测性体系基本概念 架构设计第一篇:点赞模块功能设计 ES高级第一篇:倒排索引 山海星辰 python第一篇:基础语法 pulsar基础第二篇:命令行 pulsar基础第一篇:pulsar安装及基本概念 clickhouse第三篇:安装 clickhouse第二篇:MergeTree引擎 clickhouse第一篇:引擎 redis高阶第一篇:令牌桶算法限流 http2.0 gin入参多次获取 docker第二篇:docker安装常用中间件
doris脚本
koushr · 2026-04-30 · via 博客园 - koushr

partition by

distributed by

date_trunc

将datetime按照指定的时间单位截断,即保留指定单位及更高层级的时间信息,将低层级的时间信息清零。


select date_trunc('2010-12-02 19:28:30', 'hour'),返回'2010-12-02 19:00:00'

select date_trunc('2010-12-02 19:28:30', 'day'),返回'2010-12-02 00:00:00'

date_add:date_add(<date_or_time_expr>, interval <expr> <time_unit>)

向指定的日期或时间值添加指定的时间间隔

select date_add('2023-01-31', interval 1 month),返回'2023-02-28'

select date_add('2019-01-01', interval  -3 DAY),返回'2018-12-29'

其实也可以不用date_add函数,datetime类型可以直接加减,并且可以多次加减。

date_add('2023-01-31', interval 1 month)等价于cast('2023-01-31' as datetime) + interval 1 month

cast('2023-01-31' as datetime) + interval 1 month + interval 1 day - interval 8 hour,会得到一个有效的datetime。

left semi join

select * from A left semi join B on A.user_id=B.id

是select * from A where A.user_id in (select id from B)的优化写法,只会返回A表的字段,B的字段不会返回。

left anti join

select * from A left anti join B on A.user_id=B.id

是select * from A where A.user_id not in (select id from B)的优化写法,只会返回A表的字段,B的字段不会返回。