Skip to content

date_trunc('year', '2025-04-28 12:12:12');这样用为什么会报错,文档不是写的两种方式都行吗? #2339

Open
@CaoChunfang

Description

@CaoChunfang

Path:/zh-CN/docs/sql-manual/sql-functions/scalar-functions/date-time-functions/date-trunc

Image
如题,date_trunc('year', '2025-04-28 12:12:12')使用date_trunc函数会报错,但是文档却说两种方式都行?
SQL 错误 [1105] [HY000]: errCode = 2, detailMessage = date_trunc function second param only support argument is year|quarter|month|week|day|hour|minute|second

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions