I have a structure like this in a few tables: id, [...], validfrom, validto.
The id
is a NUMBER, and the validfrom
and validto
columns are of type DATE. Any given date should not result in more than one post per id
.
So this is a correct example:
id, validfrom, validto
1, 2000-01-01, 2000-02-20
1, 2000-02-21, 2000-03-02
1, 2000-03-03, 2099-12-31
However, there seem to be some issues where a certain dates would return more than one value. Something like this (which is corrupt data):
id, validfrom, validto
1, 2001-01-01, 2001-02-20
1, 2001-01-15, 2001-03-02
1, 2001-03-03, 2099-12-31
So in the above example, any date between 2001-01-15 and 2001-02-20 would return two rows.
How would I construct a script that finds all thees corrupt posts?