Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

Filtragem da instrução SELECT por hora do dia

declare @t table(d datetime)

insert @t values('2012-01-01 09:00'),('2012-01-01 10:00'),('2012-01-01 11:00')

select cast(d as time) from @t where  cast(d as time) between '10:00' and '13:00'