title: Group events by date
body: <p>I have this Oracle table which I use for events</p>
  
  <pre><code>CREATE TABLE EVENT(
    ID INTEGER NOT NULL,
    SOURCE VARCHAR2(50 ),
    TYPE VARCHAR2(50 ),
    EVENT_DATE DATE,
    DESCRIPTION VARCHAR2(100 )
  )
  /
  </code></pre>
  
  <p>I use this SQL query to get the data by type:</p>
  
  <pre><code>SELECT EVENT_DATE, SUM(CASE WHEN TYPE = 'Error' THEN 1 ELSE 0 END) AS ERROR, 
  SUM(CASE WHEN TYPE = 'Warning' THEN 1 ELSE 0 END) AS WARN, 
  SUM(CASE WHEN TYPE = 'Info' THEN 1 ELSE 0 END) AS INFO, 
  SUM(CASE WHEN TYPE = 'Critical' THEN 1 ELSE 0 END) AS CRITICAL
  FROM EVENT E WHERE EVENT_DATE &gt;= TRUNC(SYSDATE) - 7 
  GROUP BY EVENT_DATE 
  HAVING COUNT(CASE WHEN TYPE IN ('Info', 'Warning', 'Error', 'Critical') THEN 1 END) &gt; 0
  ORDER BY EVENT_DATE
  </code></pre>
  
  <p>How I can the result for a day? I want to get all events for 7 days split for every day. I should have 7 rows of data result</p>