I'm trying to set up a sql
to check if there is any record between informed times, but it's not coming out, I've done some tests but I have not been successful.
For example, a bank record that contains these two times, as initial and final respectively:
HoraIni: 8:00 and End Time: 8:30
Any period that begins or ends during this reporting period must be selected / returned in sql
Periodos que devem retornar o registro citado a cima
7:45 até 8:15
8:00 até 8:15
But periods like these should return nothing:
Periodos sem retorno
7:45 até 8:00
8:30 até 8:45
It's a logic problem, where I can not hit maior, menor e igual
to return what I need.
The bank is MYSQL
the fields are TIME
and this select will run in a Java
function, this part is not the problem, but it stays here to solve any doubts.
I hope it has become clear, I have already looked at several examples and found nothing, if you are careful to detail that the times are equal to start and end, where the same time that ends one record starts another.