JPA-基于setParameter的按条款分组

时间:2019-12-13 23:03:34

标签: jpa spring-data-jpa

我们可以基于setParameter使用动态分组依据子句吗?

select (FLOOR(r.TTF/:binWidth) * :binWidth + :binWidth ) AS TTF,COUNT(r.SerialNumber) AS Count from RMATTFMapping r  where r.GlobalProductId in (select distinct c.GlobalProductID from ProductComponentMapping c where c.Component=:component ) AND r.CalendarMonthStartDate between :start AND :end and NOT (r.TTF in (-999) OR r.TTF is NULL) GROUP BY FLOOR(r.TTF/:binWidth) ORDER BY FLOOR(r.TTF/:binWidth) 

在上述查询中,我必须基于binWidth ( request parameter)使用分组依据,但是我遇到了"ORA-00979: not a GROUP BY expression"异常。

0 个答案:

没有答案