This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

distinct and order by Problem  RSS feed

 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am facing problem when try to execute the following query through Hibernate (HQL) and I am using Jboss 4.0.
Here is the query..


Here is the error I am getting...



The colum which iam using in order by clause is also used in distinct clause, so why I am getting "not a SELECTed expression" error ???
 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does any body have any Idea what could be problem with my Query ??, I did some research and is it possible to do this way in HQL ???, any inputs are really appreciated.
 
Keith Pitty
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the show_sql property turned on in the Hibernate configuation? If so, what is the generated SQL statement?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!