-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to return an arbitary number of entries from a select?
PostPosted: Mon Dec 01, 2003 9:04 am 
Newbie

Joined: Wed Oct 29, 2003 7:16 am
Posts: 6
How do you return an arbitary number of entries from a query, ie the first 10 when using order by ?

"select from Game game order by game.rating"

but I only want the first 10?

thanks

James


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 01, 2003 9:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Query.setMaxResults()


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 01, 2003 11:04 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
And if I remember well, Query.setFirstResult() must be > 0 to use the "Limit" feature of your DB.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 01, 2003 11:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
no, not anymore


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 01, 2003 11:21 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Cool ;-)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.