When you use GROUP by Cratetime, but one day there is no data, there will be no data one day.
So using the following SQL, you can count out every day.
Select
To_date (' 2015-06-01 ', ' yyyy-mm-dd ') +level-1 as time
from dual connect by to_date (' 2015-06-01 ', ' yyyy-mm-dd ') + Level-1 <= to_date (' 2015-06-04 ', ' yyyy-mm-dd ');
Select
(to_date (' 2015-06-01 ', ' yyyy-mm-dd ') +level-1) as time from
dual connect by Level <= To_date (' 2015-06-04 ', ' yyyy-mm-dd ')-to_date (' 2015-06-01 ', ' yyyy-mm-dd ') + 1;
The results of the query are as follows:
Time
2015-6-1
2015-6-2
2015-6-3
2015-6-4
Then use the left on link to query the statistics:
Select C_TIME,NVL (totaluser,0) as Total_user from (
select (to_date (' 2015-06-01 ', ' yyyy-mm-dd ') +level-1) as C_ dual Connect by Level <= to_date (' 2015-06-11 ', ' yyyy-mm-dd ')-to_date (' 2015-06-01 ', ' yyyy-mm-dd ') + 1
) a LEFT join (
select Trunc (u.create_time) as Create_time,count (*) as totaluser from T_user u GROUP by trunc (U.crea Te_time)