sql - In a postgresql select, add a timestamp column to an additional_days column -
in 1 column have create_dtm saved timestamp in postgresql. column integer wait_days. when pull row database want retrieve create_dtm + wait_days timestamp.
it seems should able this...will have in application code?
my non-working sample looks like:
select name, title, create_dtm + wait_days
you can add integers date not timestamp.
you can add interval timestamp value, need "convert" integer value interval of 1 day:
select name, title, create_dtm + interval '1' day * wait_days the_table; sqlfiddle example: http://sqlfiddle.com/#!15/891f5/1
(the next time, please post error message get)
Comments
Post a Comment