title: how to group a date column based on date range in oracle
body: <p>I have a table which contains a feedback about a product.It has feedback type (positive ,negative) which is a text column, date on which comments made. I need to get total count of positive ,negative feedback for particular time period . For example if the date range is 30 days, I need to get total count of positive ,negative feedback for 4 weeks , if the date range is 6  months , I need to get total count of positive ,negative feedback for each month. How to group the count based on date.</p>
  
  <pre>
  +------+------+----------+----------+---------------+--+--+--+
  | Slno | User | Comments |   type   | commenteddate |  |  |  |
  +------+------+----------+----------+---------------+--+--+--+
  |    1 | a    | aaaa     | positive | 22-jun-2016   |  |  |  |
  |    2 | b    | bbb      | positive | 1-jun-2016    |  |  |  |
  |    3 | c    | qqq      | negative | 2-jun-2016    |  |  |  |
  |    4 | d    | ccc      | neutral  | 3-may-2016    |  |  |  |
  |    5 | e    | www      | positive | 2-apr-2016    |  |  |  |
  |    6 | f    | s        | negative | 11-nov-2015   |  |  |  |
  +------+------+----------+----------+---------------+--+--+--+
  </pre>
  
  <p>Query i tried is </p>
  
  <p>SELECT type, to_char(commenteddate,'DD-MM-YYYY'), Count(type) FROM comments GROUP BY type, to_char(commenteddate,'DD-MM-YYYY');</p>