• 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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic