0

I have a table that has ARRIVE and DEPART columns like this:

ARRIVE      |    DEPART
---------------------------
2016-03-15  |    2016-04-07
2016-05-16  |    2016-05-28
etc .....

Is it possible to get the range of dates between the arrive and depart dates in MySQL so that I could use the range in a python list? Instead of doing the conversion in Python?

So for example, the ARRIVE and DEPART of 2016-05-16 2016-05-28. Would produce:

2016-05-16
2016-05-17
2016-05-18
2016-05-19
etc ...
2016-05-28
GreyTek
  • 89
  • 1
  • 1
  • 6
  • Generally this is done by having another table, either a `numbers` table or a `dates` table. Then it's relatively easy to `join` and get your desired results. – sgeddes Mar 03 '16 at 18:13
  • Are you asking for the range between the earliest arrival and latest departure, or the range between each arrival and departure? Are you asking for the range as in the number of days between the two dates? – Rodrigo C Mar 03 '16 at 18:15
  • @RodrigoC - the range of dates between each arrival and departure – GreyTek Mar 03 '16 at 18:16

0 Answers0