How to add a variable number of hours to a date in PostgreSQL?

前端 未结 4 682
攒了一身酷
攒了一身酷 2020-12-29 18:46

Apparently, PostgreSQL doesn\'t have DATEADD, because you can just use the + or - operators.

I need to add a number of hours t

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-29 18:50

    Found the answer, in another SO question:

    date + interval '1' minute * FLOOR(start_time * 60)
    

    Hope that helps anyone

提交回复
热议问题