On Sat, Jul 06, 2002 at 09:45:55PM -0700, Zachary Buckholz wrote:
> I want to run a single query to generate a daily average response time in
> seconds for a seven day period and have it return an array of 7 values (one
> for each day of the week). Currently I have to run 7 queries and change the
> between date values. Is it possible to do it in one query?
> 
> This query works, but only gives me the 24 hour period I ask for.
> SELECT AVG(monitor_report.resp_sec) FROM monitor_report WHERE
> monitor_report.toc_epoch between '2002-07-03' AND monitor_report.url_id =
> 21189

Try something like this:

SELECT TRUNC(toc_epoch), AVG(resp_sec)
FROM   monitor_report
WHERE  toc_epoch BETWEEN '2002-07-02' AND '2002-07-09'
GROUP BY TRUNC(toc_epoc)


Ronald

Reply via email to