如何将从列确定的小时数添加到时间戳列?
How to add amount of hours determined from a column to a timestamp column?
我有两列,created_time(timestamp) 和 total_hours(float):
created_time
2020-11-22 20:01:02.000
2020-11-30 03:52:16.000
2020-11-19 00:22:16.000
total_hours
66
22.97
0.18
我希望能够将 total_hours 添加到 created_time 到 return 另一列代表 completed_time。
您应该能够将时间添加到时间戳中:
select created_time + total_hours * interval '1' hour
我有两列,created_time(timestamp) 和 total_hours(float):
created_time
2020-11-22 20:01:02.000
2020-11-30 03:52:16.000
2020-11-19 00:22:16.000
total_hours
66
22.97
0.18
我希望能够将 total_hours 添加到 created_time 到 return 另一列代表 completed_time。
您应该能够将时间添加到时间戳中:
select created_time + total_hours * interval '1' hour