EXTRACT Function

Database
Highlighted
Enthusiast

EXTRACT Function

Hi,

I am using following query:

select current_time,extract(second from current_time);

It gives me the results as,

15:44:58+00:00,58

,for the projection list as specified in the SELECT statement.

But when I ammend it as,

select extract(second from current_time + 10);

then it gives me error. Why is that ? I believe ideally it should give me 10 seconds added to the seconds extracted from current time. i.e. if the seconds extracted from current_time is 40 then it should give me 50 and if the seconds extracted from current_time is 55 then it should give me 5 (as current_time uses clock intelligence).

Thanks in advance.

Alpesh


1 REPLY
Teradata Employee

Re: EXTRACT Function

Adding an integer to a Timestamp is not supported. Use an "interval" data type, e.g. current_time + interval '10' second