خرید بک لینک

Vote count: 0

So I have an SQL Query which displays: count, date, and time. This is what the output looks like: enter image description here

And below is my SQL Query:

select count(*), to_char(timestamp, 'MM/DD/YYYY'), to_char(timestamp, 'HH24')
from MY_TABLE
where timestamp >= to_timestamp('03/01/2016','MM/DD/YYYY')
group by to_char(timestamp, 'MM/DD/YYYY'), to_char(timestamp, 'HH24') 

Now, in COUNT column, I want to display 0 if the count doesn't exist for that hour. So on 3/2/2016 at 8am, the count was 6'. Then at9amthe count was0so that row didn't get displayed. I want to display that row. And at10am&11am`, the counts are displayed then it just goes to next day.

So how do I display count of 0? I want to display 0 count for each day every hour doesn't matter if it's 0 or 6 or whatever. Thanks :)

asked 15 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 10 تير 1395 ساعت: 3:24

صفحه بندی