-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Hibernate Criteria Query
PostPosted: Wed Apr 20, 2011 5:13 pm 
Newbie

Joined: Wed Apr 20, 2011 5:08 pm
Posts: 3
I am new to hibernate and I have a issue.
I have a Query SQL (select max(col1,col2,col3...) from table name where pkid in (id1,id2,id3...)
and then I need to extract the Max data from result. Means if 10 rows are returned I need the Max Value.

I need to know how to write a hibernate query for that
Any help is appreciated

Thanks

Smiley


Top
 Profile  
 
 Post subject: Re: Hibernate Criteria Query
PostPosted: Fri Apr 22, 2011 11:47 am 
Newbie

Joined: Fri Apr 22, 2011 10:16 am
Posts: 6
Hi please check your query(max function cannot contain more then one column).Then say you'r requirement i will help you


Top
 Profile  
 
 Post subject: Re: Hibernate Criteria Query
PostPosted: Fri Apr 22, 2011 7:38 pm 
Newbie

Joined: Wed Apr 20, 2011 5:08 pm
Posts: 3
The Max Function can Contain more than one col in a query. It is valid SQL and I am able to get the result.


Top
 Profile  
 
 Post subject: Re: Hibernate Criteria Query
PostPosted: Fri Apr 22, 2011 10:48 pm 
Newbie

Joined: Fri Apr 22, 2011 10:16 am
Posts: 6
Ok but i execute this query in oracle
select max(MARKS1,MARKS2) from student
it shows invalid number of arguments.
please give table structure and you'r query.


Top
 Profile  
 
 Post subject: Re: Hibernate Criteria Query
PostPosted: Wed May 04, 2011 12:36 pm 
Newbie

Joined: Wed Apr 20, 2011 5:08 pm
Posts: 3
Try this in DB2 and that will work


Top
 Profile  
 
 Post subject: Re: Hibernate Criteria Query
PostPosted: Thu May 05, 2011 5:02 am 
Newbie

Joined: Thu May 05, 2011 4:45 am
Posts: 3
Any help is appreciated

_________________
Give up you is not my fault, and the wrong is lack of the money-tiffany jewelry
While there is life, there is hope tiffany jewelry cheap.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.