select ticktime from stocktechnicaldataentity where
ticktime::time>'09:30:00.000' AND ticktime::time<'15:00:00.000' limit 50;
当我在postgresql中使用此查询时,当我在jpql中使用此查询时,它会给出正确的结果。它不起作用。
JPQL查询 -
String sql1="select tickTime from stocktechnicaldataentity where
tickTime::time>'09:30:00.000' AND tickTime::time<'15:00:00.000' limit 50";
Query query = entityManager.createQuery(sql1);
List<Object[]> results = query.getResultList();
提供错误
引起:异常[EclipseLink-0](Eclipse持久性服务 - 2.6.4.qualifier):org.eclipse.persistence.exceptions.JPQLException异常描述:语法错误解析[select tickTime from stocktechnicaldataentity其中tickTime :: time&gt; '09:30:00.000'AND tickTime :: time&lt; '15:00:00.000'limit 50]。