1 Reply Latest reply: Jun 19, 2012 10:37 AM by Irian RSS

    Reg Group by function

    944524
      I want to get an output using group by function of there is no data in the table to display a particular value

      for eg:

      SELECT TRUNC(updated_date) DATE1 , COUNT(1) COUNT FROM table
      where TRUNC(updated_date) >=TRUNC(SYSDATE-18) AND TRUNC(updated_date) <=TRUNC(SYSDATE)
      GROUP BY TRUNC(updated_date)
      ORDER BY TRUNC(updated_date) DESC;

      DATE1     COUNT
      6/16/2012     14208
      6/15/2012     307825
      6/14/2012     172988
      6/6/2012     138790
      6/5/2012     167562
      6/4/2012     51870
      6/2/2012     130582
      6/1/2012     239806

      But i need the missed out date i.e 6/3/2012 - 0, 6/7/2012 - 0 to be displayed since there is no data on the repective dates.