-->
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: How to do this sort?
PostPosted: Thu Jul 08, 2004 5:26 am 
Beginner
Beginner

Joined: Sun Nov 16, 2003 9:30 am
Posts: 20
Hi all , I have a table relationship as follow :

cart <--- item

I retrieve the cart by
select cart, sum(cart.price) from foo.Cart cart join cart.item item

So I would like to :
1) sort the retrieved item by sum(cart.price) and then cart.createDate
2) page it using setMaxResults(10)

How could I do it most simply ? As I tried
select cart, sum(cart.price) pricesum from foo.Cart cart join cart.item item order by pricesum, cart.CreateDate
which is invalid.

THanks for help.

Perseus


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.