【问题标题】:Oracle db: how to get current_time?Oracle db:如何获取 current_time?
【发布时间】:2018-05-14 17:51:39
【问题描述】:

Mysql 有 current_time。 oracle db的等价物是什么?

select current_time

current_time
--------------------
15:30:16

【问题讨论】:

    标签: sql oracle current-time


    【解决方案1】:

    你可以使用SYSDATE:

    SELECT TO_CHAR(SYSDATE, 'HH24:MI:SS') "current_time"
    FROM DUAL;
    

    【讨论】:

    • 转换为字符串。可以映射到java.sql.Time for JDBC吗?
    • 是的。如果需要日期时间,请不要将其转换为字符串。
    • @Sunnyday:Oracle 没有time 数据类型。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-03
    • 1970-01-01
    • 2016-07-24
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多