-->
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.  [ 4 posts ] 
Author Message
 Post subject: How do I do this in HQL?
PostPosted: Wed Feb 15, 2006 3:38 pm 
Newbie

Joined: Wed Feb 15, 2006 3:26 pm
Posts: 5
I'm using PostgreSQL and NHibernate 1.0.2 and I have to use following HQL:

SELECT EXTRACT(EPOCH FROM sum(x.End - x.Start))
FROM TASK AS x
WHERE x.ID=5

I get a QueryException saying "undefined alias or unknown mapping: EXTRACT". EXTRACT is a function in Postgres so its clear why it is saying that but what can I do to solve this?


Top
 Profile  
 
 Post subject: Any suggestions?
PostPosted: Tue Feb 21, 2006 6:04 am 
Newbie

Joined: Wed Feb 15, 2006 3:26 pm
Posts: 5
Any suggestions?


Top
 Profile  
 
 Post subject: Re: Any suggestions?
PostPosted: Tue Feb 21, 2006 8:26 am 
Beginner
Beginner

Joined: Thu Feb 16, 2006 9:53 am
Posts: 24
Is that query a sub query?
if not why don't you just query for x and then do the computation in java?


Top
 Profile  
 
 Post subject: Re: Any suggestions?
PostPosted: Wed Feb 22, 2006 9:55 am 
Newbie

Joined: Wed Feb 15, 2006 3:26 pm
Posts: 5
alexism wrote:
Is that query a sub query?
if not why don't you just query for x and then do the computation in java?


That's what I did but with PostgreSQL doing the work it would be faster... but not enough to effort more time getting this to work. So I'll keep this solution. Thank you!


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