[英]SQL i want to select time from timetable but checks all the time values in other table which not be selected
here is the time table that I use 这是我使用的时间表
time "table"
---------------
1 | 07:00:00
2 | 08:00:00
3 | 09:00:00
4 | 10:00:00
5 | 11:00:00
6 | 12:00:00
7 | 13:00:00
8 | 14:00:00
these table is the one where I check the time must not be be select 这些表是我检查时间不能选择的表
sched_daytime "table"
---------------
Day Start_time End_time
-------------------------------------
Monday | 07:00:00 | 08:00:00
Wednesday | 08:00:00 | 10:00:00
Monday | 09:00:00 | 11:00:00
here is my sql query 这是我的SQL查询
select time.*
from time,sched_daytime
where time not between sched_daytime.s_time and sched_daytime.e_time
AND sched_daytime.day = 'Monday'
group by time.time
but the result is its still shows all time values in time table which suppose between 7:00 to 8:00 and 9:00 to 11:00:00 are not available time 但结果是它仍然显示时间表中的所有时间值,这些时间值假定在7:00至8:00和9:00至11:00:00之间不可用
its select all the values in time table please help sorry im still noob 它选择时间表中的所有值,请帮助我抱歉,还是菜鸟
尝试以下操作:从time,sched_daytime中选择时间,其中day ='Monday'并且时间不在start_time和end_time之间按时间分组
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.