• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql
You are here: Home / Oracle / function / Oracle NUMTOYMINTERVAL Function

Oracle NUMTOYMINTERVAL Function

November 5, 2012 by techhoneyadmin

SQL NUMTOYMINTERVAL FunctionOracle NUMTOYMINTERVAL Function is used to convert any number to an Interval Year to Month Literal.


Oracle NUMTOYMINTERVAL Function Syntax

SELECT NUMTOYMINTERVAL(number,expression)
FROM table_name;
  • ‘number’ is the number to be converted to interval
  • ‘expression’ is the unit and can have the following values: ‘YEAR’ or ‘MONTH’

Oracle NUMTOYMINTERVAL – Converting to MONTH Example

Oracle NUMTOYMINTERVAL is used in SQL SELECT Statement to convert any number to an Interval Year to Month Literal.

For example, the below SQL Query converts 300000000 to MONTH.

SELECT NUMTOYMINTERVAL(300000000, 'MONTH')
FROM DUAL;

May return “+25000000-00”


Oracle NUMTOYMINTERVAL – Converting to YEAR Example

NUMTOYMINTERVAL can convert any number to an Interval Year type also.

For example, the below SQl Query converts 300000 to YEAR.

SELECT NUMTOYMINTERVAL(300000, 'YEAR')
FROM DUAL;

May return “+300000-00”


Filed Under: function Tagged With: how to use numtoyminterval function in oracle database query, how to use numtoyminterval function in oracle plsql, how to use numtoyminterval function in oracle sql, numtoyminterval function in oracle plsql, numtoyminterval function in oracle sql, NUMTOYMINTERVALPLSQL, syntax and example of numtoyminterval function in oracle database query, syntax and example of numtoyminterval function in oracle plsql, syntax and example of numtoyminterval function in oracle sql, using numtoyminterval function in oracle database query, using numtoyminterval function in oracle plsql, using numtoyminterval function in oracle sql

Copyright © 2023 · Parallax Pro on Genesis Framework · WordPress · Log in