Quick Search:
 
 The Oracle PL/SQL MONTH Keyword      [Return To Index] Jump to:  

Term: MONTH

Definition:
In Oracle PL/SQL, MONTH is a datetime field which specifies a month contained by a date value in either a numeric or string format. It is valid for both DATETIME and INTERVAL data type values. The valid value range for MONTH in datetime values is 1-12, while for INTERVAL values it is 0-11. It can be extracted using the EXTRACT function from a DATETIME or INTERVAL value.

Example Usage:

The SQL below extracts the month from the current date.

SQL> SELECT EXTRACT(MONTH FROM SYSDATE) FROM DUAL;

EXTRACT(MONTHFROMSYSDATE)
-------------------------
12


The SQL below extracts month from the Interval period.

SQL> SELECT EXTRACT(MONTH FROM TO_YMINTERVAL('1-4')) FROM DUAL;

EXTRACT(MONTHFROMTO_YMINTERVAL('1-4'))
--------------------------------------
4



Related Links:

Related Code Snippets:
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org