title: How do I sum records by week using pl/sql?
body: <p>I have a query in Oracle for a report that looks like this:</p>
  
  <pre><code>SELECT TRUNC (created_dt) created_dt
      ,  COUNT ( * ) AllClaims
      ,  SUM(CASE WHEN filmth_cd in ('T', 'C') THEN 1 ELSE 0 END ) CT
      ,  SUM(CASE WHEN filmth_cd = 'W' THEN 1 ELSE 0 END ) Web 
      ,  SUM(CASE WHEN filmth_cd = 'I' THEN 1 ELSE 0 END ) Icon 
  FROM claims c
  WHERE c.clsts_cd NOT IN ('IN', 'WD')
     AND  TRUNC (created_dt) between 
      to_date('1/1/2006', 'dd/mm/yyyy') AND 
      to_date('1/1/2100', 'dd/mm/yyyy')
  GROUP BY TRUNC (created_dt)
  ORDER BY TRUNC (created_dt) DESC;
  </code></pre>
  
  <p>It returns data like this:</p>
  
  <pre><code>Create_Dt  AllClaims   CT    Web    Icon
  1/26/2011  675         356   285    34
  1/25/2011  740         322   379    39
  ...
  </code></pre>
  
  <p>What I need is a result set that sums all of the daily values into a weekly value.  I am pretty new to PL/SQL and not sure where to begin.</p>