unexpected token: ( near line 1, column 59 [from com.esoft.archer.user.model.UserBill bill inner join (select user.id,max(seqNum) as seq from com.esoft.archer.user.model.UserBill group by user.id)tmp where bill.user.id=tmp.user.id and bill.seqNum=tmp.seq order by bill.user.id]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 59 [from com.esoft.archer.user.model.UserBill bill inner join (select user.id,max(seqNum) as seq from com.esoft.archer.user.model.UserBill group by user.id)tmp where bill.user.id=tmp.user.id and bill.seqNum=tmp.seq order by bill.user.id]