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: Selecting Rows where hourly data changed

Re: Selecting Rows where hourly data changed

From: Venki Ramachandran <venkir_at_wacsinc.com>
Date: Mon, 23 Jul 2001 10:28:10 -0700
Message-ID: <3B5C5EAA.F58996F@wacsinc.com>

Hi,

It is difficult to recommend without knowing the layout of the table but you could try the following:

  1. If you want all the distinct values then do a select distinct (timestamp, name, value) from table where name = 'interested_name'. That will give you all the rows that has a different value.
  2. I would write a PL/SQL proc, define a cursor, sort the select in the cursor by time and then compare the most recent record with the previous one to see if it changed.

Just my 2 cents ...

-VR

Renee Tumbleson wrote:

> I have a table that contains hourly data of several different
> categories that is collected every hour by a separate software
> package. This table contains a timestamp,name, and value for several
> objects in several categories. For one particular category of data,
> the hourly values, do not change too often. I cannot figure out how
> to select in this particular category the first timestamp where the
> name and value are distinct.
>
> SELECT DISINCT NAME,VALUE ........
>
> I have tried several different things and the query either hangs up or
> gives me bogus results.
>
> Thanks for the help.
>
> Renee Tumbleson
> tumblesonr_at_firstenergycorp.com
Received on Mon Jul 23 2001 - 12:28:10 CDT

Original text of this message

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