Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

distinct and order by Problem

 
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?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!