개인적인 정리

[Oracle] NUMTOYMINTERVAL() 본문

DB/ORACLE

[Oracle] NUMTOYMINTERVAL()

yeon.Biju 2020. 4. 13. 13:48

오라클 NUMTOYMINTERVAL()

 

NUMTOYMINTERVAL()

   - 

 

NUMTOYMINTERVAL(n, interval_unit)

의 형태

 

NUMTOYMINTERVAL converts number n to an INTERVAL YEAR TO MONTH literal. The argument n can be any NUMBER value or an expression that can be implicitly convrted to a NUMBER value. The argument interval_unit can be of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type. The value for interval_unit specified the unit of n and must resolove to one of the following string values:

 

  • 'YEAR'
  • 'MONTH'

interval_unit  is case insensitive. Leading and trailing values within the parentheses are ignored. By default, the precision of the return is 9.

 

 

오라클 oe 계정으로 테스트 가능

 

 

SQL>SELECT
    last_name,
    hire_date,
    salary,
    SUM(salary) OVER (ORDER BY hire_date RANGE NUMTOYMINTERVAL(1, 'YEAR') PRECEDING) AS t_sal
FROM employees
ORDER BY last_name, hire_date ;

 

'DB > ORACLE' 카테고리의 다른 글

[Oracle] POWER()  (0) 2020.04.14
[Oracle] PERCENT_RANK()  (0) 2020.04.14
[Oracle]NVL2()  (0) 2020.04.13
[Oracle] NVL()  (0) 2020.04.13
[Oracle]NUMTODSINTERVAL()  (0) 2020.04.13
[Oralce] NULLIF()  (0) 2020.04.13
[Oracle] NTILE()  (0) 2020.04.13
[Oracle] NTH_VALUE()  (0) 2020.04.10
Comments