Home > database >  ORACLE query different a certain time period the number of welding equipment, the query how to write
ORACLE query different a certain time period the number of welding equipment, the query how to write

Time:10-03

Table structure
RN_DATA_ID welding ID, RN_DATA_EQUIP_ID device ID, RN_DATA_D537 workpiece welding quantity, RN_DATA_UP_TIME update time and data format (2016/12/20 Tuesday afternoon 1:01:28)

I want to query language sentence out the 20161201-20161220 period, welding ID is equal to the total number of welding workpiece (1, 2, 3) devices,

Note: the data is updated every second, a real-time updates, workpiece welding real-time cumulative number of every last one of the data number of the workpiece welding for the welding of the day, the second day 0 when the workpiece welding number zero new count,

Please help

Such as data:
RN_DATA_ID RN_DATA_EQUIP_ID RN_DATA_D537 RN_DATA_UP_TIME
1 1 0 2016/12/20 Tuesday afternoon 1:01:29
2 2 2 2016/12/20 Tuesday afternoon 1:01:29
3 3 1 2016/12/20 Tuesday afternoon 1:01:29
4 1 1 2016/12/20 Tuesday afternoon 1:01:30
5 2 4 2016/12/20 Tuesday afternoon 1:01:30
6 3 3 2016/12/20 Tuesday afternoon 1:01:30
7 1 3 2016/12/20 Tuesday afternoon 1:01:31
8 2 6 2016/12/20 Tuesday afternoon 1:01:31
9 3 5 2016/12/20 Tuesday afternoon 1:01:31

CodePudding user response:

 select RN_DATA_EQUIP_ID, sum (RN_DATA_D537) 
The from tab_name
Where to_char (RN_DATA_UP_TIME, 'yyyymmdd') between '20161201' and '20161220'
Group by RN_DATA_EQUIP_ID;

Very simple statement? Is to be like this?

CodePudding user response:

No, one day a ID can be more than one data, the data is updated in real time, a per second,

CodePudding user response:

Was not an ID, a day to more than one data, the data is updated IN real time, the second one, but also more than three sets of equipment, equipment need to take ID IN (1, 2, 3) equipment after every last one of the data, summarize the number of welding
  • Related