![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Thank you! That definitely helps. I did just think of another possibility though. Maybe a smarter way to do this would be a test for any set where the temperature difference is greater than a certain value. With the update above I am not sure how to do this as the final where clause is outside the 'tl_good' select clause so obviously I can't use the 'tl_good.degrees_f' in the test. Is there an easy way to do this? Bill |
![]() |
| Thread Tools | |
| Display Modes | |
| |