Home > database >  Oracle time processing of SQL query in data must meet the conditions of continuous time. Ask Daniel
Oracle time processing of SQL query in data must meet the conditions of continuous time. Ask Daniel

Time:10-05

Real-time data uploaded to the database, and every day and will produce a lot of data, need to query in data must meet the conditions of continuous time,
Such as: there is a time in table t_A, quantity, unit, load and other fields, load 200-260260-300300-330 three conditions, equipment operation in real time to upload data, need to look for more than 30 consecutive minutes load stability among the above three conditions for a kind of all of the data, and then averaging the data for 30 minutes, such as the unit in the 2016-09-01 13:10:12 to 2016-09-01 13:55:12 range of time running under the load of 260-300, stability time is 45 minutes, more than 30 minutes, then check out 2016-09-01 13:40:12 to 2016-09-01 13:55:12 time the average of the data, namely query 30 minutes after 15 minutes of the average of the data, could you tell me how to do? One day can have more time to meet more than 30 minutes stability data, to query,

CodePudding user response:

First, understand your general meaning, but don't know how to seek after 15 minutes of the average
Second, to the best part of the data, and give you the expected results

CodePudding user response:

reference 1st floor ghx287524027 response:
first, understand your general meaning, but don't know how to seek after 15 minutes of the average
Second, to the best part of the data, and give you the expected results of

If not 15 minutes after the average value, and all the average of the plateau, and how to do?

CodePudding user response:

refer to the second floor sinat_35263095 response:
Quote: refer to 1st floor ghx287524027 response:

First, understand your general meaning, but don't know how to seek after 15 minutes of the average
Second, to the best part of the data, and give you the expected results of

If not 15 minutes after the average value, and all the average of the plateau, and how to do?

Temporarily no good data, the data of the first picture give you look at the

CodePudding user response:

Your data and your question is very chaos ah, first of all, your data is a record every half hour or an hour at a time? What kind of data that is not stable? Second, in the data as if also is related to the original coal id, based on the analysis of the need to consider the field, or just consider the unit? After ask questions, to oneself can have a look at first based on the description read what you want to do

CodePudding user response:

reference 4 floor ghx287524027 response:
your data and your question is very chaos ah, first of all, your data is a record every half hour or an hour at a time? What kind of data that is not stable? Second, in the data as if also is related to the original coal id, based on the analysis of the need to consider the field, or just consider the unit? After ask questions, to oneself can have a look at first based on the description read what you want to do
the data is, indeed, there is a problem, in fact within half a small article there will be a lot of data, but the meaning is the same, a corresponding unit more than the original coal id, is actually to show each of the original coal id in the stability of the load during the period of data, roughly mean you almost got it, I basically have no idea now,

CodePudding user response:

reference 5 floor sinat_35263095 reply:
Quote: refer to 4th floor ghx287524027 response:

Your data and your question is very chaos ah, first of all, your data is a record every half hour or an hour at a time? What kind of data that is not stable? Second, in the data as if also is related to the original coal id, based on the analysis of the need to consider the field, or just consider the unit? After to ask questions, to oneself can have a look at first based on the description read what you want to do
the data is, indeed, there is a problem, in fact within half a small article there will be a lot of data, but the meaning is the same, a corresponding unit more than the original coal id, is actually to show each of the original coal id in the stability of the load during the period of data, roughly mean you almost got it, I basically have no ideas now,

If the unstable data, how to choose data? Q me 212646490

CodePudding user response:

refer to 6th floor ghx287524027 response:
Quote: refer to the fifth floor sinat_35263095 reply:

Quote: refer to 4th floor ghx287524027 response:

Your data and your question is very chaos ah, first of all, your data is a record every half hour or an hour at a time? What kind of data that is not stable? Second, in the data as if also is related to the original coal id, based on the analysis of the need to consider the field, or just consider the unit? After to ask questions, to oneself can have a look at first based on the description read what you want to do
the data is, indeed, there is a problem, in fact within half a small article there will be a lot of data, but the meaning is the same, a corresponding unit more than the original coal id, is actually to show each of the original coal id in the stability of the load during the period of data, roughly mean you almost got it, I basically have no ideas now,

If the unstable data, how to choose data? Q me 212646490

time background for the green of the corresponding amount, mt, aar is the need to calculate and display the page data, direct sum amount, mt and aar weighted average

CodePudding user response:

- Create table
The create table COMPARE_TEST_REALDATA
(
Ci_name VARCHAR2 (200),
Time DATE,
The value NUMBER (16, 4),
Sid VARCHAR2 (200)
);
- Add comments to the table
Comment on the table COMPARE_TEST_REALDATA
Is' imitation of real-time database data;
- Add comments to the columns
Comment on the column COMPARE_TEST_REALDATA. Ci_name
The name 'is' index;
Comment on the column COMPARE_TEST_REALDATA. Time
Is' time ';
Comment on the column COMPARE_TEST_REALDATA. Value
Is' point value;
Comment on the column COMPARE_TEST_REALDATA. Sid
Is' SID ';

Insert into COMPARE_TEST_REALDATA (CI_NAME, TIME VALUE, SID)
SELECT "FH", SYSDATE - level/24/60, round (dbms_random. Value (90110), 4), 'WDR'
The FROM DUAL
Connect by level & lt; 24 * 60=


Select min (aa) time), and Max (aa) time), count (1) the from
(select a. *, rownum RNA from (select * from COMPARE_TEST_REALDATA order by time) a) aa
Left the join (select c. *, rownum RNB from (select * from b. COMPARE_TEST_REALDATA b
Where b.v alue & gt; * 0.05=100-100
And b.v alue & lt; + 100 * 0.05=100
The order by time) c) bb
On aa. Time=bb. Time
Where RNB is not null
Group by (RNA - RNB)
Having a count (1) & gt; 5
The order by min (aa) time)
  • Related