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

Home -> Community -> Mailing Lists -> Oracle-L -> SQL Join or Subquery

SQL Join or Subquery

From: Gary Chambers <gc22_at_lucent.com>
Date: Wed, 17 Jul 2002 13:54:14 -0800
Message-ID: <F001.0049AC98.20020717135414@fatcity.com>


All...

I have a question about a query over which I've been racking my brain for weeks, and I can't find a reference to adequately assist me.

Given a table of temperature sensors, and a table of readings from those sensors, how might I grab the max (hence latest or current) temperature reading for each sensor? The relevant fields in the tables are timestamp and temp_c (temperature table), and sensorid (both temperature and sensor tables).

I'm fairly certain that I'm overlooking something very elementary, and I feel it should be simple and straightforward, but I think I'm being stymied by the use of aggregate functions in my query. I can provide examples of my failed attempts, if you'd like. Thanks in advance for any assistance you can provide.

Gary Chambers

//-------------------------------------

// Lucent Technologies GIO/Unix
// 4 Robbins Road, Westford, MA 01886
// 978-399-0481 / 888-480-6924 (Pager)
// Nothing fancy and nothing Microsoft
//-------------------------------------


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Gary Chambers
  INET: gc22_at_lucent.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jul 17 2002 - 16:54:14 CDT

Original text of this message

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