We are getting syntax error in group by clause while using group by with case statement in JPA named queries. We are using openjpa. Query looks like this(ids is a list in mentioned query)
select r.city,case when r.name='test' then 'T' else 'N' end as opt from testable r where r.id in (:ids) group by r.city,case when r.name='test' then 'T' else 'N' end