1
Hello.
I’m having trouble drafting a SELECT that checks whether the End Date of the first query record is greater than the start date of the second.
The database in question is of notes and for some reason, some notes were with the start date smaller than the previous end date.
To illustrate better I will use the terms Attendance, Pending and Time, remembering that a call can contain more than one pending and a pending may contain more than one time.
The intention is to identify which times within a particular service that are with the end date longer than the start date of the next record.
This only within the service, that is, can not be compared for example the end date of CDTEMPO 256261 with the start date of CDTEMPO 256269. Why they are different calls.
I need ideas on how to identify these times. It doesn’t have to be necessarily by SELECT, it could be by Procedure also without problems. In this select or precise precedent it would be displayed the same fields as the image above, and return only the record that has the start date less than the end date of the previous record.
In theory select/Procedure should return this to me:
Thanks in advance!
What marks the registry order ? I would try a Join with the table itself , something like key=key-1
– Motta
Check any overlaps within a call or within a call/pending?
– anonimo