ORACLE SQL DEVELOPER Query ?
Posted on 2016-09-02
I have the below query that pulls the number of calls by hour today, what i would like to do is pull the data for the last 10 days, but have each day represented as a column and then it show null or 0 if no data for that interval.
I need to use the query in ORACLE SQL DEVELOPER
select to_char(startdate, 'hh24'), count(*) as totalcalls
where startdate >= TRUNC(SYSDATE) - 1/86400
group by to_char(startdate, 'hh24')
order by to_char(startdate, 'hh24');
I would like data to be represented like this
HR - Then a column for previous 10 days.
7 11 12 22 35 16 12