計算time1+time2<=3000的總個數
select countIf(time1+time2<=3000) from table
計算求a*b大於等於0的和
select sumIf(a*b,a*b>=0) from table
查找列表中包含某個id的數據 ['aa','bb']
select * from table where has(ids,'aa')
字符串轉datetime類型
toDateTime('2022-02-23 11:49:00')
求一個Date/DateTime時間減去時間差,再返回一個時間Date/DateTime
subtractSeconds(toDateTime('2019-10-30 16:29:00'), 120)
subtractYears,subtractMonths,subtractWeeks,subtractDays,subtractours,subtractMinutes,subtractSeconds,subtractQuarters都可以
求兩個時間的時間差
SELECT dateDiff('hour', toDateTime('2018-01-01 22:00:00'), toDateTime('2018-01-02 23:00:00'));
轉換為時間戳
toUnixTimestamp(datetime)
toUnixTimestamp(str, [timezone])
獲取某個時間的整分 整點等。
toStartOfYear,toStartOfISOYear,toStartOfQuarter,toStartOfMonth,toMonday,toStartOfWeek(t[,mode]),toStartOfDay,toStartOfHour,toStartOfMinute,toStartOfSecond將datetime類型取整點
SELECT toStartOfMinute(toDateTime('2022-03-15 11:03:03'))

查找同時不以多個字符串開頭的數據,multiSearchAllPositions相當於查找某些字符在 當前的哪個位置,如果是1,則表示以這個text/ccs開頭,如果是0,則表示在content-type中沒找到
multiSearchAllPositionsCaseInsensitive可以不區分大小寫搜索
select * from table where multiSearchAllPositions(content_type,['text/ccs','application/javascript','image/','font/'])==[0,0,0,0]
