简体   繁体   English

SQL我想从时间表中选择时间,但检查未选中的其他表中的所有时间值

[英]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.

相关问题 SQL从所有不在其他表中的表中选择 - SQL select from all from table that are not in other table 我想同时从不同字段的2个不同表中获取两个不同的值 - i want to fetch the two different values from the 2 diffrent table of diffrent fields at the same time 我想从一个表中获取所有数据并将它们插入另一个表中,但只有第一行插入多次而不是所有行 - I want to fetch all data from a table and insert them in another table but only first row is inserting multiple time instead of all row 我想验证从下拉列表中选择的时间是否超过当前时间 - I want to validate when time selected from drop down list is past current time 我想选择一个表并使用我选择的表中的相同数据创建一个表 - I want to select a table and create a table with the same data from the table i selected 我想在php中选择最小日期和时间 - I want to select min date and time in php SQL:获取与每个相关的所有其他值必须在另一个表中的值 - SQL: Getting values which all other values related to each must be in another table 如何从表中选择除外表中的值以外的所有值? - How to select all the values from a table except the values which are in foreign table? sql 查询以检查事件是否过期,该查询在两个单独的列中检查日期和时间 - sql query to check for expiration of event, which checks for both date and time in two separate columns 从表的选定行中获取所有值 - get all values from a selected row of the table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM