Check overlap of date ranges in MySQL
I had such a query with a calendar application I once wrote. I think I used something like this: … WHERE new_start < existing_end AND new_end > existing_start; UPDATE This should definitely work ((ns, ne, es, ee) = (new_start, new_end, existing_start, existing_end)): ns – ne – es – ee: doesn’t overlap and doesn’t match (because … Read more