嗨,我想在 JPQL 中使用“order by”。我试过的代码是
em.createQuery("SELECT o.productCode,SUM(o.quantity) FROM OrderDetailsEntity o GROUP BY o.productCode ORDER BY SUM(o.quantity)")
我努力了
em.createQuery("SELECT o.productCode,SUM(o.quantity) AS quant FROM OrderDetailsEntity o GROUP BY o.productCode ORDER BY quant")
等待答案:(