跳转到内容

将时间舍入到半小时。

func.time_slot(<expr>)
func.time_slot('2023-11-12 09:38:18.165575')
┌───────────────────────────────-───-───-──────┐
│ func.time_slot('2023-11-12 09:38:18.165575') │
│ Timestamp │
├─────────────────────────────────-───-────────┤
│ 2023-11-12 09:30:00 │
└─────────────────────────────────-───-────────┘
time_slot(<expr>)
参数 说明
<expr> 时间戳

TIMESTAMP,以“YYYY-MM-DD hh:mm:ss.ffffff”格式返回。

SELECT
time_slot('2023-11-12 09:38:18.165575')
┌─────────────────────────────────────────┐
│ time_slot('2023-11-12 09:38:18.165575') │
│ Timestamp │
├─────────────────────────────────────────┤
│ 2023-11-12 09:30:00 │
└─────────────────────────────────────────┘