Reputation: 960
I am running MySQL query (not HQL) with Hibernate. I am trying to use Group by desc
and it gives me exception -
unexpected token: desc near line 1, column 340
The same query, however, works when I run it in mySQL command line.
Upvotes: 0
Views: 80
Reputation: 77906
That's because desc
is a reserve word and should be escaped using backtique like below. Better yet, don't use reserve word at all (OR) if you had to then try using some other word along with it like desc_HQL
Group by `desc`
Upvotes: 1