-->
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.  [ 2 posts ] 
Author Message
 Post subject: Extracting the 20 best students from the DB
PostPosted: Tue Apr 29, 2008 12:15 am 
Newbie

Joined: Sat Mar 01, 2008 12:36 pm
Posts: 1
Hi Folks,

I have a channelging query to write. I need your help. I have a database of students. Studenst are graded from 1 to 20.

I want to write a query that returns the 20 best students out of 2000 students. Any idea?

Thanks,
Klaus.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 29, 2008 3:05 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
use a combination of order by and setMaxResults(20)

_________________
Sanne
http://in.relation.to/


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