Home > database >  Oracle statistics no increment for 5 days
Oracle statistics no increment for 5 days

Time:09-21

Have A oracle SQL problem, want to ask ace to solve, for example as follows: head office have 40 branches, A day will pass the ETL process synchronous 4 table data increment to the head office, ETL program has A log table will produce logs, such as how much incremental company A new report today, how much is the storage time, the new report how much incremental company B, how much is the storage time, now want to calculate A month, five consecutive days without reports the increment of the number of each branch, such as 1-5, there is no new measurement of 1, 7-11 without continuous increment, the accumulation time, want to write A SQL statistics, or write A stored procedure, but don't know how to write, A great god please help solve, thank you all for the great god,

CodePudding user response:

1,4,5,6,7,8,9
1,3,4,6,7,8,9
1,3,4,5,6,8,9
1, 10

A few times, respectively

CodePudding user response:


Select the m1. *, lead (sj, 1, null) over (partition by gs order by sj) - sj as JGTS from m1
You can try

CodePudding user response:

Five consecutive days without incremental: problem description is not very clear,
If 5 - N consecutive days? How to calculate the number?
  • Related