0
Query query = session.createSQLQuery("SELECT ((extract (epoch from (end_time::timestamp - start_time::timestamp))))::integer from Trip_Details where td_id = "+transacId+" ");
在Postgres的SQL 2个时间戳之间的区别我想这个查询来获取之间的两个时间戳即START_TIME,stop_time的差异中。如何获得Java中
但得到例外下面
ERROR: stderr - org.hibernate.QueryException: Not all named parameters have been set: [:timestamp, :integer] [SELECT ((extract (epoch from (end_time::timestamp - start_time::timestamp))))::integer from Trip_Details where td_id = 1 ]
及其postgres的PG的管理控制台上工作正常和获得输出如在整数格式202秒。
请帮我找出错误并解决它。 在此先感谢
可你'查询查询=执行Session.createSQLQuery(“SELECT((提取物(从(END_TIME ::时间戳时代 - start_time :: timestamp)))):: Trip_Details中的整数,其中td_id ='+ transacId +'');'in Java?.. –