我们可以基于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"
异常。