-->
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.  [ 1 post ] 
Author Message
 Post subject: Top N Results From Each Group
PostPosted: Sun Aug 23, 2009 1:08 am 
Newbie

Joined: Sun Aug 23, 2009 1:02 am
Posts: 1
I need to do something like retrieve the top 10 selling products from each category, or the lowest cost items from each category (by category code) using a combination of I'd guess criteria or straight HQL. I am using MySQL.

I've scoured the documentation. HQL does not support LIMIT or ROWNUM. I'd assumed, I need to write a correlated subquery that queries the top 10 products in a given category and then qualifies the product based on the subquery.

What is the best way to go about doing something like this Hibernate?

Any suggestions appreciated.


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

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.