你说你看不懂openGauss我都不信(116)

33 阅读1分钟

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/

  • date_part(text, timestamp)

    描述:获取日期/时间值中子域的值,例如年或者小时的值。等效于extract(field from timestamp)。

    timestamp类型:abstime、date、interval、reltime、time with time zone、time without time zone、timestamp with time zone、timestamp without time zone。

    返回值类型:double precision

    示例:

    sql 代码解读复制代码openGauss=# SELECT date_part('hour', timestamp '2001-02-16 20:38:40');
     date_part 
    -----------
            20
    (1 row)
    

#openGauss #入门 #安装 #数据库 #开源

知识来源:docs-opengauss.osinfra.cn/zh/