All Forums Database
Alpesh 8 posts Joined 11/05
02 Jan 2007
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

Fred 583 posts Joined 08/04
02 Jan 2007

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

You must sign in to leave a comment.