Reputation: 33297
I want to order my result by name in alphabetic order. I tested this:
select u.name from User as u
order by u.name desc
This did not work. How can I sort alphabetically?
Upvotes: 0
Views: 2320
Reputation: 2876
This query is correct, there is nothing wrong in it:
select u.name from User as u order by u.name desc
But there is problem in this query:
from User u select u.name order by u.name
The syntax does not seems correct. For more queries you can see: org hibernate
Upvotes: 1
Reputation: 12228
This works for me in a console:
User.executeQuery("Select u.name from User u order by u.name desc")
Upvotes: 1
Reputation: 1028
If you are looking for a Hibernate Query Language, try this:
from User u select u.name order by u.name
Upvotes: 2