-->
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 project in HQL
PostPosted: Thu Jan 28, 2010 12:53 am 
Newbie

Joined: Wed Jan 27, 2010 9:20 pm
Posts: 2
Hi am totally new to Hibernate, and have an SQL statement that I need to convert into HQL hope someone can please help?

SQL Statement
Quote:
SELECT max(SenseValue)-min(SenseValue)
FROM IODeviceData
WHERE NetworkID= 80
AND IODeviceID=129
AND SenseDate >= '2010-01-01' /**etc.**/
AND SenseDate <= getDate()


And have got so far in HQL without errors... (am using Netbeans6.8 to run HQL statements)
Quote:
from IodeviceData
WHERE NetworkID=80
AND IODeviceID=129
AND SenseDate >= '2010-01-01'
AND SenseDate <= GETDATE()


However am unable to use the SELECT to project just the needed values as in when i add following keep getting errors:

Quote:
SELECT max(SenseValue)-min(SenseValue)


Hope someone can help me to find the max-min value?? thanks


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.