개인적인 정리

[Oracle]ROUND(date) 본문

DB/ORACLE

[Oracle]ROUND(date)

yeon.Biju 2020. 6. 10. 14:14

오라클 ROUND(date)

 

ROUND(date)

   -

 

ROUND(date)

ROUND(date, fmt)

의 형태

 

ROUND returns date rounded to the unit specified by the format model fmt. The function is not sensitive to the NLS_CALENDAR session parameter. It operates according to the rules of the Gregorian calendar. The value returned is always of data type DATA, even if you specify a different datetime data type for date. If you moit fmt, then date is rounded to the nearest day. The date expression must resolve to a DATE value. 

 

SQL > SELECT ROUND(TO_DATE('2020-05-01', 'YYYY-MM-DD'), 'YEAR') FROM DUAL ;

   --> 2020/01/01

 

SQL> SELECT ROUND(TO_DATE('2020-05-22', 'YYYY-MM-DD'), 'MONTH') FROM DUAL ;

   --> 2020/06/01

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

[Oracle]RTRIM()  (0) 2020.06.11
[Oracle]RPAD()  (0) 2020.06.11
[Oracle]ROW_NUMBER()  (0) 2020.06.11
[Oracle]ROUND(number)  (0) 2020.06.10
[Oracle]REPLACE()  (0) 2020.06.10
[Oracle]REMAINDER()  (0) 2020.06.10
[Oracle]REGEXP_SUBSTR()  (0) 2020.06.08
[Oracle]REGEXP_REPLACE()  (0) 2020.06.08
Comments