we have a data warehouse. One of the tables is a history table.
The history key is just to unify a row.
The apparaat-key means that al these rows belong to one apparaat.
In this example there is just one apparaat, in the table there are hundreds different ones.
vanaf- and tot-en-met-datum are the date boundaries for every change on apparaat.
recent-ind means that this is the most recent record.
The first set of four lines is correct.
The second and third set of four lines have a mistake.
The dates are not completely correct. There are gaps.
In the second set there is a gap between the tot-en-met-datum of row 2 and the vanaf-datum of row three.
There is also a gap in the third set.
Is it possible to write one query to check if there are gaps in the dates for each and every apparaat? The result of the query must be the apparaten where mistakes are found.