V
V
Viktor1472017-01-19 16:54:59
Oracle
Viktor147, 2017-01-19 16:54:59

How to find violations in the historicity of the table?

There is a historical table table1 of the form:
id
number_history - record number in the history in order 1,2,3 ...
start_date - record start date
end_date - record end date
According to the filling rules, the next historical record in this table should be as
follows The start_date field of the next record equals the end_date field of the previous record.
Within one record, the following condition is met: start_date <= end_date
The question is how to find violations of the conditions ? For example, when the start_date of the next record > end_date of the
previous one and all intersections, when the time ranges of different records can overlap, overlap?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2017-01-19
@Viktor147

If oracle is not lower than 11
1) Analytic functions select end_date of the previous record
docs.oracle.com/cloud/latest/db112/SQLRF/functions...
2) Compare

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question