SQL 92, 93 and 99 (i have not checked 2003) all limit order-by to only be allowable in the root query.
Unfortunately the current HQL grammar allows subqueries to be ordered. So I wanted to start a discussion of whether we want to support this as we transition to SQM and 6.0. The real problem with supporting ordering of a subquery is that neither HQL nor JPQL support pagination of a subquery which is honestly the only time that ordering the subquery makes any sense. So IMO we have 2 choices: 1. Add a new pagination syntax to the HQL language and continue to allow ordering of subqueries 2. drop support for ordering subqueries. Thoughts? _______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev