Home > database >  Questions about oracle value by subtracting the hour
Questions about oracle value by subtracting the hour

Time:09-26

The NAME VALUE TIME

Zhang SAN 150 2017-09-11 12:00:01
Li si 280 2017-09-11 12:00:01
Lao wang 157 2017-09-11 12:00:01
Zhang SAN 153 2017-09-11 12:06:01
Li si 287 2017-09-11 12:06:01
Lao wang 179 2017-09-11 12:06:01

-- -- -- -- -- -- -- data for five seconds at a time, the name is fixed, the value can be understood as their power consumption, power consumption is always in the accumulation, for each of them an hour respectively of the total value variation, (i.e., 13 point minus 12=an hour power consumption) -- -- -- -- -- -- -- -- -- --

Zhang SAN 170 2017-09-11 13:06:01
Li si 320 2017-09-11 13:01:01
Lao wang 277 2017-09-11 13:01:01
Note: thank you brother, grateful! Figure in the table structure is similar to the structure of the question

CodePudding user response:

An hour is the total value of variation zhang SAN why 170
The total amount is not change, right

CodePudding user response:

Didn't read the result data,

CodePudding user response:

Partition by TRUNC (SYSDATE, 'HH24) Max (value) - min (value)

CodePudding user response:

What kind of result expected? One hour for each of them respectively of the total value variation, is hours accumulated value, or the current one hour on the maximum minus a maximum of one hour?
  • Related