BETWEEN IN SQL 检查两次之间的时间

BETWEEN IN SQL to check a time between two times

是否可以使用 BETWEEN 检查第二天 19:00 到 08:00 之间的时间?我只使用 time。(不是 datetime

select *
from MyTable
where CAST(mytime as time) >= '19:00:00' 
   and CAST(mytime as time) < '08:00:00'

当然可以:

时间不在“8:00”和“19:00”之间

试试这个方法

select *
from MyTable
where Datetimecolumn >= convert(datetime,'2016-05-16 19:00:00') 
   and Datetimecolumn <=dateadd(hh,12,convert(datetime,'2016-05-16 19:00:00'))