Hello, I have a problem with constructing a query which uses group-by and sorts by an aggregate column. As I use MySQL, I can't just write "ORDER BY min(column)", so I try a different approach, which works in MySQL, but throws an exception when I try to use it in EJB3. My query looks like this:
SELECT name, min(dateCreated) AS mdc FROM TagEntity
GROUP BY name
ORDER BY mdc
Any ideas how can I do it any other (working :) ) way?