2016-04-20 37 views
0

我有一个演讲表和演讲时间表列表。仅限于日期时间列的时间

我想创建一个查询,让我过滤它的时间比例。例如,我想找到所有持续1小时的讲座(我不介意它在哪一天)。

我创建了一个代码,到目前为止,但它不会带来任何结果:

select time(lecturetime) 
from lecture 
where lecturetime >= '12:00:00' and lecturetime < '13:00:00' 

有人能解决这个给我吗?

回答

2

不要混淆时间(lecturetime)lecturetime

select time(lecturetime) 
from lecture 
where time(lecturetime) >= '12:00:00' and time(lecturetime) < '13:00:00' 
+0

非常感谢,这个工程。我得到了我想要的结果。 – mrteeth