码迷,mamicode.com
首页 > 数据库 > 详细

Oracle函数

时间:2019-07-06 19:05:31      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:date   sele   oracl   acl   返回   timestamp   ext   code   min   

-- EXTRACT函数:返回具体的年、月、日、时、分、秒等具体时间。
SELECT EXTRACT (YEAR FROM --SYSDATE
       SYSTIMESTAMP
       ) YEAR FROM DUAL;
       
SELECT EXTRACT (MONTH FROM --SYSDATE
       SYSTIMESTAMP
       ) YEAR FROM DUAL;
       
SELECT EXTRACT (DAY FROM --SYSDATE
       SYSTIMESTAMP
       ) YEAR FROM DUAL;
       
SELECT EXTRACT (HOUR FROM SYSTIMESTAMP) YEAR FROM DUAL;

SELECT EXTRACT (MINUTE FROM SYSTIMESTAMP) YEAR FROM DUAL;

SELECT EXTRACT (SECOND FROM SYSTIMESTAMP) YEAR FROM DUAL;

SELECT EXTRACT (DAY FROM SYSTIMESTAMP) YEAR FROM DUAL;

SELECT EXTRACT(YEAR FROM ORDERDATE) AS O

--EG:
SELECT EXTRACT(YEAR FROM SYSDATE) AS YEAR_,
       EXTRACT(MONTH FROM SYSDATE) AS MONTH_,
       EXTRACT(DAY FROM SYSDATE) AS DAY_
       FROM DUAL

 

Oracle函数

标签:date   sele   oracl   acl   返回   timestamp   ext   code   min   

原文地址:https://www.cnblogs.com/tanjiyuan/p/11143521.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!