Hello, I have a problem for generate a criteria query, and even in HQL i don't knwo how to do it.
I have a table Action (#ActionId, ActionDate, ActionGroup), and the associated class ActionVO (AcnId, AdnDate, AcnGroup)
I want to retrieve the last action of each group. So in sql should be something like: SELECT A.* from Action A JOIN (select ActionGroupe, max(ActionDate) as dt_action from Action group by ActionGroupe) B ON A.ActionGroupe = B.ActionGroupe AND A.ActionDate = B.ActionDate;
Any idea of how to do this in Criteria ? Thank you very much.
Last edited by hibernatus09 on Tue Dec 08, 2009 12:18 pm, edited 1 time in total.
|