MySQL Forums
Forum List  »  Newbie

Schedules
Posted by: Bevan Robinson
Date: August 20, 2018 11:17PM

I have a table of schedules, in each schedule (row) I have a DepartureTime and ArrivalTime, these columns are unix timestamps.

What I want to do is check to see if another schedule overlaps with a proposed new row. For example, imagine I have just one schedule

Dep: 1524466800 Arr: 1524466900

Now, my new row is Dep: 1524466750 and Arr: 1524466820

So essentially overlapping with another row.

It'll be okay if it's entirely before (so both departure and arrival before) or after other rows.

To run the check i'll count rows I guess but how do I do the query itself

Options: ReplyQuote


Subject
Written By
Posted
Schedules
August 20, 2018 11:17PM
August 21, 2018 12:07AM
August 21, 2018 08:24AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.