我想知道是否可以在@Query注释中使用子查询(org.
springframework.data.jpa.repository.Query;)
我在第一个子查询parentesis上得到QuerySyntaxException.
这是我的查询
@Query(value="select c1 from ComplaintModel c1," + "(select c2.id,min(cb.termDate) minDate from ComplaintModel c2 " + "join c2.complaintBullets cb join cb.status s where s.code = ?1 " + "group by c2.id) tmp where c1.id = tmp.id order by tmp.minDate")
谢谢!