Description: NUMTODSINTERVAL converts n to an INTERVAL DAY TO SECOND literal. The argument n can be any NUMBER value or an expression that can be implicitly converted to a NUMBER value. The argument interval_unit can be of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 datatype. The value for interval_unit specifies the unit of n and must resolve to one of the following string values:
'interval_unit' is case insensitive. Leading and trailing values within the parentheses are ignored. By default, the precision of the return is 9.
Language: PL/SQL Highlight Mode: PLSQL Last Modified: March 05th, 2009
NUMTODSINTERVAL(n,<interval_unit>)-- The following example uses NUMTODSINTERVAL in a COUNT -- analytic function to calculate, for each employee, the -- number of employees hired by the same manager within the -- past 100 days from his or her hire date. SELECT manager_id, last_name, hire_date,COUNT(*) OVER (PARTITIONBY manager_id ORDERBY hire_date
RANGENUMTODSINTERVAL(100,'day') PRECEDING)AS t_count
MANAGER_ID LAST_NAME HIRE_DATE T_COUNT
---------- ------------------------- --------- ----------100 Kochhar 21-SEP-891100 De Haan 13-JAN-931100 Raphaely 07-DEC-941100 Kaufling 01-MAY-951100 Hartstein 17-FEB-961
SQL University.net courses meet the most demanding needs of the business world for advanced education
in a cost-effective manner. SQL University.net courses are available immediately for IT professionals
and can be taken without disruption of your workplace schedule or processes.
Compared to traditional travel-based training, SQL University.net saves time and valuable corporate
resources, allowing companies to do more with less. That's our mission, and that's what we deliver.