[GENERAL] Retrieving the start and end hour queries correctly

2012-08-13 Thread dud
I have a CTE-based query in which I retrieve hourly intervals between two given timespans. My query works as following: Getting start and end datetimes (let's say 07-13-2011 00:21:09 and 07-31-2011 21:11:21) get the hourly total query values between the hourly intervals (in here it's from 00 to 21

[GENERAL] How to get results with zero count from this query?

2012-08-01 Thread dud
Hello, I have a database table that contains information about the timestamp and location(latitude and longtitude) of the requests made by users. The column structure is as following: requesttime(which is a timestamp without time zone type) | latitude | longtitude I have written the followi