跳转到内容

将带时间的日期(timestamp/datetime)转换为 UInt8 数字,表示分钟中的秒数(0-59)。

func.to_second(<expr>)
func.to_second('2023-11-12 09:38:18.165575')
┌──────────────────────────────────────────────┐
│ func.to_second('2023-11-12 09:38:18.165575') │
│ UInt8 │
├──────────────────────────────────────────────┤
│ 18 │
└──────────────────────────────────────────────┘
TO_SECOND(<expr>)
参数 说明
<expr> 时间戳

TINYINT

SELECT
to_second('2023-11-12 09:38:18.165575')
┌─────────────────────────────────────────┐
│ to_second('2023-11-12 09:38:18.165575') │
│ UInt8 │
├─────────────────────────────────────────┤
│ 18 │
└─────────────────────────────────────────┘