Desearia saber si hay una forma de crear una consulta SQL para verificar la continuidad entre fechas sobre un item.? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Desearia saber si hay una forma de crear una consulta SQL para verificar la continuidad entre fechas sobre un item.?

tengo una tabla CURSOS: itemDocente codigoCurso fecha_inicio fecha_fin deseo saber si en los lapsos entre el fin de un curso y el inicio de otro no pasan mas de 5 dias del mismo profesor ejemplo: item codigo fecha inicio fecha fin 205 x1 2/3/2017 5/3/2017 205 x2 10/3/2017 20/4/2017 205 x3 12/3/2017 12/4/2017 si ven el curso x2 y x3 estan solapados pero desde que termino x1 pasaron 5 dias que no tenia clases el profesor. gracias por su atencion

31st Jul 2017, 7:56 PM
Victor Manuel Hernandez
Victor Manuel Hernandez - avatar
1 Answer
+ 1
I would like to know if there is a way to create an SQL query to verify the continuity between dates on an item. I have a table COURSES: itemDocente codeCourse begin_date end_date I want to know if in the lapses between the end of a course and the beginning of another do not spend more than 5 days of the same teacher example: item code date start date end 205 x1 2/3/2017 5/3/2017 205 x2 10/3/2017 20/4/2017 205 x3 12/3/2017 12/4/2017 If you can see the course x2 and x3 are overlapping but since I finished x1 spent 5 days that I did not have classes That teacher.
31st Jul 2017, 8:21 PM
Victor Manuel Hernandez
Victor Manuel Hernandez - avatar