使用 postgres 中选定列的值添加时间间隔

add time interval with value from selected column in postgres

我是 Postgres 的新手,想知道是否有更好的方法来解决 Postgres 中的时间间隔问题。

在 MySQL 我有:

Select STR_TO_DATE(start_time - interval (tkc + tct) second + interval 3 hour, '%Y-%m-%d %H:%i:%s') as start_time 
from table

对于 Postgres,我发现并将查询写为:

select start_time - (interval  '1 second' * (tkc + tct)) + interval  '3 hour' 
from table

谢谢大家的回答。很高兴成为社区的一员。

我能够按照下面的方式解决这个问题。

select start_time - ((tkc + tct)|| ' seconds')::interval + interval '3 hour' as start_time from table