is the following I'm creating an online schedule and I need to list them and show the schedules that are not scheduled, to show the free time. And for this I created the scheduling_table, where in the column schedules_fixes the list of schedules, and in the other table the scheduling is where the schedules are and I need the value that is in the scheduling_table in the case in the column schedules_fixes, only the schedules that do not appear have been scheduled, and the problem that is happening that is appearing example:
I need the values of a table with fixed times not to appear in the select.
The fixed times are: 02:00 02:10 02:20 02:30
Then a person scheduled the time from 02:00 to 02:30, so the times of 02:10, 02:20 are appearing in the select and should not.
follows the query I made:
SELECT horariosfixos
FROM agendamento_horarios
WHERE horariosfixos NOT IN(SELECT horaInicio
FROM agendamento
WHERE data = '17-10-2016'
UNION
SELECT horaFim
FROM agendamento
WHERE data = '17-10-2016')
If you can help me, I'm grateful.