Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Simple update problem
b_addams_at_yahoo.com wrote in
news:1116713893.977189.42480_at_f14g2000cwb.googlegroups.com:
> Hello. I have a table that stores readings from temperature sensors
> every 15 minutes. My problem is that one of them had a problem and kept
> reading the same temperature for a couple of days. Luckily (and
> surprisingly), this particular one is one of the few that had a backup
> sensor. So, what I am trying to do is update the problem sensor's
> readings with the backup sensor's readings for an approximately two day
> period. I am having trouble with the syntax on the update. Can anyone
> help?
>
> Here is the table info:
>
> SQL> describe temperature_log
> Name Null? Type
> ----------------------------------------- --------
> ----------------------------
> SYSTEM_TIMESTAMP NOT NULL DATE
> SENSOR_ADDRESS NOT NULL VARCHAR2(4)
> DEGREES_F NOT NULL NUMBER(38)
> DEGREES_C NOT NULL VARCHAR2(8)
>
> I am trying to put the two temp fields from the rows with an 'FFFF'
> address into the rows with a '6DA9' address for a period of time.
>
> Thanks.
> Bill
>
>
Your problem statement & terminology leave a lot to be desired, IMO. I speculate that you do NOT really want to UPDATE. I suspect you should DELETE the bad rows and INSERT rows from the backup sensor.
Or can & do you guarentee that during the period of interest, a one to one match in timestamps occur for both sensors? Received on Sat May 21 2005 - 17:32:55 CDT