遇到一坑:对于如下代码

select * from order_mileagefuel where date > '2015-11-1' and date< '2015-11-5' 

在PostgreSQL的客户端中执行时能得到结果,但在Java中执行时(此时时间范围是参数,类型为String),如date &gt;=#{startDay} and date &lt;=#{endDay}

执行时报如下错误:(而对于MySQL,在代码中却是能够正确执行的。)

ERROR: operator does not exist: timestamp without time zone > character varying

解决方法:将String类型的参数改为java.sql.Timestamp

相关文章:

  • 2021-11-19
  • 2021-11-05
  • 2021-11-19
  • 2022-12-23
  • 2021-12-12
  • 2021-05-29
  • 2021-12-25
猜你喜欢
  • 2021-11-20
  • 2021-12-12
  • 2021-12-18
  • 2021-11-19
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案