I am stuck with the question how to check if a time span overlaps other time spans in the database.
For example, my table looks like this:
id start end
1 11:00:00 13:00:00
2 14:30:00 16:00:00
Now I try to make a query that checks if a timespan overlaps with one of these timespans (and it should return any time spans that overlaps).
When I try
14:00:00 - 15:00:00
it should return the second row.When I try
13:30:00 - 14:15:00
it shouldn't return anything.When I try
10:00:00 - 15:00:00
it should return both rows.
It's hard for me to explain, but I hope someone understands me enough to help me.