Examples - Teradata Vantage NewSQL Engine - 16.20

Teradata Vantageā„¢ Data Types and Literals

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

Example: Converting numeric_value into an INTERVAL DAY(100) TO SECOND Value

The following query:

SELECT NUMTODSINTERVAL(100, 'DAY'); 

returns the result '100 00:00:00.000000', which is 100 days.

Example: Converting numeric_value into an INTERVAL DAY(100) TO HOURS Value

The following query:

SELECT NUMTODSINTERVAL(100, 'HOURS'); 

returns the result '4 04:00:00.000000', which is 4 days, 4 hours.

Example: Converting numeric_value into an INTERVAL DAY(100) TO MINUTES Value

The following query:

SELECT NUMTODSINTERVAL(1600, 'MINUTES'); 

returns the result '1 02:40:00.000000', which is 1 day, 2 hours, 40 minutes.

Example: Converting numeric_value into an INTERVAL DAY(100) TO HOURS Value

The following query:

SELECT NUMTODSINTERVAL(3.5, 'HOURS'); 

returns the result 3 hours, 30 minutes.