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: Group By not working ..hmmm...
PostPosted: Tue May 24, 2011 10:28 am 
Newbie

Joined: Tue May 24, 2011 10:18 am
Posts: 1
Hi all,
In my query I am selecting a subset (not the whole object) so my approach was as follows (SUBSTRING VALUE TRUNCS TIMESTAMP AT DAY)

SELECT new DataObject( SUBSTRING(timeStamp,1,10) as timeStamp, avg(dataReading) AS dataReading)
FROM DataObject
WHERE timeStamp BETWEEN starDate AND endDate
GROUP BY timeStamp //this would be by day

what I expect is an object for each day
what i receive is each object (not grouped)

I believe that it is making the objects first and then it is not able to group them... any suggestions???


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.