-->
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: nhibernate agregate functions
PostPosted: Wed Jul 25, 2007 11:47 am 
Newbie

Joined: Wed Jul 25, 2007 11:39 am
Posts: 11
Hello,

Having mytable(id, begin_time, end_time, name) and the mapping file for it, can anyone tell me how a query that returns a list having (min(begin_time), max(end_time)) items would look like ?
So, it should return something like this:

results
---------------------
min(begin_time)
max(end_time)

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 26, 2007 4:25 am 
Regular
Regular

Joined: Wed Apr 25, 2007 4:18 am
Posts: 51
Location: Belarus, Gomel
Hi bhibernate!

Read here about aggregation
http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/queryhql.html#queryhql-aggregation

I think you can't get result as "list" - but it is not so hard to convert objects array to whatever you need.

_________________
WBR, Igor


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.