In grouping nested query, the clause for ordering is invalid.