我正在尝试动态地将具有不同小时间隔的时间戳插入Postgres (12.1)、NodeJS 10.15.3和Knex中。通过Postico直接插入Postgres,NOW() + INTERVAL 'n hours'格式工作正常: insert into users (first_name, updated_at)
valuesinvalid input syntax for type timestamp with time zone: "NOW() + INTERVAL '2 h
我希望根据updated_on时间戳来聚合数据,在postgres中,JPQL.The查询中的聚合间隔应该超过2小时。我使用了以下查询:
@Query("select DATE_TRUNC('day',srisk.updatedOn)+cast(DATE_PART('hour',srisk.updated_on) assrisk.updatedOn BETWEEN :fromDate and :toDate and srisk.siteI