In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces android how to achieve the summation of working hours in a fixed period of time, which is very detailed and has a certain reference value. Interested friends must read it!
We have encountered this situation twice recently, which is similar to using the clock-in time to calculate the sum of working hours over a period of time. The table data given is roughly like this.
ID: workshop ID
Gid: device id
ACTIVITY: type, there are two types: in on, out off
Time: the point in time to start or shut down
The requirement now is to enter a start time and an end time to find the working time of each equipment (the same equipment in the same workshop) within this range.
Exception data handling:
1. Duplicate data needs to be deduplicated.
two。
3. A continuous out needs to take the first
4. If the start time of a time period is less than the input start time, it is calculated according to the input start time
5. If the end time of a time period is greater than the input end time, it is calculated according to the input end time
The table input above
The final result is
You can try it.
The data is below:
CREATE TABLE "SYSTEM". "AAREPORT" ("ID" VARCHAR2 (255BYTE), "ACTIVITY" VARCHAR2 (255BYTE), "TXNTIMESTAMP" DATE, "GID" VARCHAR2 (255BYTE) TABLESPACE "SYSTEM" LOGGINGNOCOMPRESSPCTFREE 10INITRANS 1STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) PARALLEL 1NOCACHEDISABLE ROW MOVEMENT
-Records of AAREPORT-- INSERT INTO "SYSTEM". "AAREPORT" VALUES ('1mm,' in', TO_DATE ('2020-07-1508),' SYYYY-MM-DD HH24:MI:SS'),'a') INSERT INTO "SYSTEM". "AAREPORT" VALUES ('1th,' out', TO_DATE ('2020-07-1603 out', TO_DATE,' SYYYY-MM-DD HH24:MI:SS'),'a'); INSERT INTO "SYSTEM". "AAREPORT" VALUES ('2percent,' in', TO_DATE ('2020-07-1508),' SYYYY-MM-DD HH24:MI:SS'),'b') INSERT INTO "SYSTEM". "AAREPORT" VALUES ('3th,' in', TO_DATE ('2020-07-15 10 out', TO_DATE),' SYYYY-MM-DD HH24:MI:SS'),'a'); INSERT INTO "SYSTEM". "AAREPORT" VALUES ('3th,' out', TO_DATE ('2020-07-1602),' SYYYY-MM-DD HH24:MI:SS'),'a') INSERT INTO "SYSTEM". "AAREPORT" VALUES ('3th,' in', TO_DATE ('2020-07-16 10 in', TO_DATE 0000,' SYYYY-MM-DD HH24:MI:SS'),'a'); INSERT INTO "SYSTEM". "AAREPORT" VALUES ('44th,' in', TO_DATE ('2020-07-1601) 0000,' SYYYY-MM-DD HH24:MI:SS'),'a') INSERT INTO "SYSTEM". "AAREPORT" VALUES ('44th,' out', TO_DATE ('2020-07-1602out', TO_DATE),' SYYYY-MM-DD HH24:MI:SS'),'a'); INSERT INTO "SYSTEM". "AAREPORT" VALUES ('44th,' in', TO_DATE ('2020-07-160900VALUES,' SYYYY-MM-DD HH24:MI:SS'),'a') INSERT INTO "SYSTEM". "AAREPORT" VALUES ('44th,' out', TO_DATE ('2020-07-17 2121 SYYYY-MM-DD HH24:MI:SS'),' a'); INSERT INTO "SYSTEM". "AAREPORT" VALUES ('1bn,' in', TO_DATE ('2020-07-1507l07l0700 SYYYY-MM-DD HH24:MI:SS'),' b')) INSERT INTO "SYSTEM". "AAREPORT" VALUES ('1th,' out', TO_DATE ('2020-07-16 04VALUES,' SYYYY-MM-DD HH24:MI:SS'),'b'); INSERT INTO "SYSTEM". "AAREPORT" VALUES ('3th,' in', TO_DATE ('2020-07-18 1200 SYYYY-MM-DD HH24:MI:SS'),' b')) INSERT INTO "SYSTEM". "AAREPORT" VALUES ('3th,' in', TO_DATE ('2020-07-1708in', TO_DATE),' SYYYY-MM-DD HH24:MI:SS'),'b'); INSERT INTO "SYSTEM". "AAREPORT" VALUES ('3th,' out', TO_DATE ('2020-07-17 1800 SYYYY-MM-DD HH24:MI:SS'),' b')) The above is all the contents of the article "how to achieve the summation of working hours in a fixed period of time by android". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.