-->
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: doing a left join on 'all dates' in a date range
PostPosted: Wed Jan 25, 2012 8:06 pm 
Newbie

Joined: Tue Jan 10, 2012 8:29 pm
Posts: 6
Hi,
I have a sql query where I give date range (from, to) as input and I want results of distinct count of users for all values of dates in that range, right now the sql would return only the values when its non zero, it would skip the date in the result set otherwise..
I want to get all dates in the result set and have a count as 0 if there is no value for that date.

I am assuming this will require doing a left join of users table on a "complete list of dates in the given date range", how do I go about doing this using hibernate?

users table: (id, currdate, userid)


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.