zoukankan      html  css  js  c++  java
  • Oracle计算时间函数(对时间的加减numtodsinterval、numtoyminterval) (转)

    原文来自:http://blog.itpub.net/756652/viewspace-697256/

    11g interval分区,按天分区,需要用到函数numtodsinterval。
     
    create table T_PAR
    (
    dt date
    )
    partition by range (dt)
    interval(numtodsinterval(1,'day'))
    (
    PARTITION SYS_001 VALUES LESS THAN (TO_DATE('20110501','yyyymmdd'))
    );
     
    ###################################################################
     
    numtodsinterval(,),x是一个数字,c是一个字符串,

    表明x的单位,这个函数把x转为interval day to second数据类型
    常用的单位有 ('day','hour','minute','second')
    example
    SQL> select sysdate,sysdate+numtodsinterval(3,'hour') as res from dual;
    SYSDATE             RES
    ------------------- -------------------
    2007-09-05 01:45:34 2007-09-05 04:45:34
    numtoyminterval与numtodsinterval函数类似,将x转为interval year to month数据类型
    常用的单位有'year','month'
    example
    SQL> select sysdate,sysdate+numtoyminterval(3,'year') as res from dual;
    SYSDATE             RES
    ------------------- -------------------
    2007-09-05 01:54:53 2010-09-05 01:54:53
  • 相关阅读:
    连通分量板子
    2017年7月17日
    强连通缩点— HDU1827
    马拉车代码
    表达式求值
    Gym-100883F、Gym-101095B状态压缩小结
    矩阵快速幂小结-Hdu2604
    3月27日
    简单移动端自适应轮播图
    上了热搜榜前端工程师面试内幕
  • 原文地址:https://www.cnblogs.com/aigeileshei/p/6230883.html
Copyright © 2011-2022 走看看