我是靠谱客的博主 鲤鱼胡萝卜,这篇文章主要介绍clickhouse查询每天大于某个时间的数据,现在分享给大家,希望可以做个参考。

直接上语句:

select formatDateTime(datatime,'%H') as hour  from mytable where hour>'10';

查询结果:

┌─hour─┐
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 11   │
│ 16   │
└──────┘

在官方文档中是这么说的:

formatDateTime(Time, Format[, Timezone])

Function formats a Time according given Format string. N.B.: Format is a constant expression, e.g. you can not have multiple formats for single result column.

Supported modifiers for Format: ("Example" column shows formatting result for time 2018-01-02 22:33:44)

ModifierDescriptionExample
%Cyear divided by 100 and truncated to integer (00-99)20
%dday of the month, zero-padded (01-31)02
%DShort MM/DD/YY date, equivalent to %m/%d/%y01/02/2018
%eday of the month, space-padded ( 1-31)2
%Fshort YYYY-MM-DD date, equivalent to %Y-%m-%d2018-01-02
%Hhour in 24h format (00-23)22
%Ihour in 12h format (01-12)10
%jday of the year (001-366)002
%mmonth as a decimal number (01-12)01
%Mminute (00-59)33
%nnew-line character ('n') 
%pAM or PM designationPM
%R24-hour HH:MM time, equivalent to %H:%M22:33
%Ssecond (00-59)44
%thorizontal-tab character ('t') 
%TISO 8601 time format (HH:MM:SS), equivalent to %H:%M:%S22:33:44
%uISO 8601 weekday as number with Monday as 1 (1-7)2
%VISO 8601 week number (01-53)01
%wweekday as a decimal number with Sunday as 0 (0-6)2
%yYear, last two digits (00-99)18
%YYear2018
%%a % sign%

最后

以上就是鲤鱼胡萝卜最近收集整理的关于clickhouse查询每天大于某个时间的数据的全部内容,更多相关clickhouse查询每天大于某个时间内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部