暂无图片
返回数说广场
Kubee
2025-03-24
在 PostgreSQL 数据库中,查询当前时间的正确命令是: A. `SELECT current_timestamp;` B. `SELECT current_time;` C. `SELECT now();` ### 解释: - **`current_timestamp`**:返回当前日期和时间(`timestamp with time zone` 类型)。 - **`current_time`**:返回当前时间(`time with time zone` 类型)。 - **`now()`**:返回当前日期和时间(`timestamp with time zone` 类型),与 `current_timestamp` 等效。 ### 错误选项: - **D. `SELECT sysdate FROM dual;`** 这是 Oracle 数据库的语法。在 PostgreSQL 中,`sysdate` 和 `dual` 表并不存在。`dual` 是 Oracle 数据库中用于返回单行单列数据的虚拟表,而 PostgreSQL 不需要这样的表。 因此,正确答案是 **A、B 和 C**。
0
暂无图片 0
113
分享

评论

热门数说