SQL - Interval Function on a column

I am trying to add date to a second from a column and update a new column. This sql is executing fine "select trunc(sysdate-364)+ interval '10' second from dual;" but the interval variable is dynamic and I am trying to specify a column in it say like this "select trunc(sysdate-364)+ interval 'column_name' second from table_name;" and the sql fails let me know how do I specify a column in the interval function. Thanks.

Comments

  • I was able to solve my requirement using TIMESTAMPADD function. Coming from oracle background there are many SQL functions to learn in vertica.
  • This can be done using timestampadd: select timestampadd(ss,intrval,trunc(sysdate-364)) from (select 10 as intrval from dual) a /Sajan

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file