title: How to only retrieve the average of values in one day over the duration of multiple days
body: <p>Hopefully the title isn't too confusing. Here is my code</p>
  
  <pre><code>SELECT SRV_NAME, TOT_CPU, TOT_MEM, SNAP_DATE
  FROM capacity2.SRV_CAPACITY_UNIX
  WHERE TOT_CPU &gt;= 90 OR TOT_MEM &gt;= 90 AND SNAP_DATE BETWEEN to_date('14-jun-2012 00:00:00', 'dd-mon-yyyy hh24:mi:ss') AND to_date('14-jul-2012 00:00:00', 'dd-mon-yyyy hh24:mi:ss')
  ORDER BY SRV_NAME desc, SNAP_DATE desc;
  </code></pre>
  
  <p>A sample of the data the code returns is as follows:</p>
  
  <pre><code>SNAP_DATE       TOT_CPU TOT_MEM SRV_NAME
  6/22/2012 0:00  99.98   70.86   server555
  6/22/2012 0:05  99.98   70.9    server555
  6/22/2012 0:10  99.98   70.93   server555
  6/22/2012 0:15  99.98   71.06   server555
  6/22/2012 0:20  99.98   70.87   server555
  ...
  6/22/2012 23:35 99.97   71.12   server555
  6/22/2012 23:40 99.99   71.12   server555
  6/22/2012 23:45 99.97   71.12   server555
  6/22/2012 23:50 99.98   71.12   server555
  6/22/2012 23:55 99.98   71.12   server555
  </code></pre>
  
  <p>The objective:</p>
  
  <p>Extract data for servers (the servers are within the <code>capacity2.SRV_CAPACITY_UNIX</code> database) that are 90% and above (in <code>TOT_CPU</code> and <code>TOT_MEM</code>) over a given duration (in this case a month/30 days). I need to graph this data and by default the data is recorded every 5 minutes so I'm left with 288 rows in one day over the span of approximately 30 days. This is approximately 8,600 rows that I am left with to plot on a graph which is obviously impractical. </p>
  
  <p>Therefore what I need to do is to write a SQL query that will only extract the average <code>TOT_CPU</code> and <code>TOT_MEM</code> of each day so I will only be left with 30 rows of data I need to plot for 30 days (one row for each day).</p>
  
  <p>This is my first time using Stack Overflow so I have attempted to be as clear as possible. If you need any information I will surely provide it.</p>