MySQL: a timespan available within consecutive times -


I have a table which is the constant time and date for an agenda.

Date of ID start_out time_image1 05-02-15 19:00:00 19:05:00 2 05-02-15 19:05:00 19:10:00 3 05 -02 -15 19:10:00 19:15:00 4 05-02-15 19:15:00 19:20:00 5 05-02-15 19:20:00 19:25:00 6-02-12 -15 19:25:00 19:30:00 7, 05-02-15 19:30:00 19:35:00 8, 05-02-15 19:35:00 19:40:00 9 06-02-15 19: 00:00 19:05:00 10 06-02-15 19:05:00 19:10:00 11 06-02-15 19:10:00 19:15:00 12 13 14 06-02-15 19: 25:00 19:30:00 15-06-02-15 19:30:00 19:35:00 16 06-02-15 19:35:00 19:40:00

As you can see that 05-02-15 time is constant from 19:00 to 1940

as you go to 06-02-15 You can see from time to time 19:00 to 19:15 continuously

As you can see on 06-02-15, from 19:25 to 1940 If the constant is

start time and end time is always a difference of 5 minutes.

I have to make all the dates, which are continuously x So when x = 30 , the result is:

  05-02-15  

when X = 10 , the result is:

  05-02-15 06-02-15  

Ideas for an approach

maybe the first step is to continuously calculate the number of records is to get all the parts, the second part (when x = 30, we need at least 30 minutes / 5 minutes = 6).

This query checks that you have @ x / 5 next @ X Free slots in minutes and if so, covering their entire @x minute interval means they are consistent.

  set @ x = 15; T1 DTAT and T2BGAT = T1 DOT and T2BBG & gt; from the agenda_specialists` as joining T1. = T 1.bizen and T.bizen & lt; Aedtaim (T Lkbigin, Sekand_to_taim 60)) x @ count (*) = by t1.id Group / 5  


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -