Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: one for the SQL experts - dare I say TRICKY SQL!

Re: one for the SQL experts - dare I say TRICKY SQL!

From: <markc600_at_hotmail.com>
Date: 7 Feb 2006 05:17:26 -0800
Message-ID: <1139318246.514858.196180@o13g2000cwo.googlegroups.com>


Some DDL and sample data would be useful. Here's an untested shot in the dark...

CREATE TABLE THREADLIFECYCLE (unique_id INT, start_time DATETIME NOT NULL,
end_time DATETIME)

CREATE TABLE MONITORRESULTS(unique_id INT, time_of_measurement DATETIME NOT NULL,
value DECIMAL(10,2))

SELECT t.unique_id AS ThreadID,AVG(m.value) AS AverageValue FROM MONITORRESULTS m
INNER JOIN THREADLIFECYCLE t ON m.time_of_measurement BETWEEN t.start_time and t.end_time
GROUP BY t.unique_id Received on Tue Feb 07 2006 - 07:17:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US