I need an SQL script which would search between time intervals
I need an SQL query that will do the following:
select ..........
from ....
where ....
and arrival_time between systemtime and (systemtim开发者_如何学运维e + 7 hours )
arrival_time BETWEEN current_timestamp AND current_timestamp + INTERVAL '7' hour
You can use tochar function and intervel function to achieve this... like
SELECT ..... FROM WHERE ... and to_char(arrival time,'mm/dd/yyyy hh24:mi:ss') BETWEEN to_char(sysdate,'mm/dd/yyyy hh24:mi:ss') AND to_char(sysdate + interval '7' HOUR,'mm/dd/yyyy hh24:mi:ss').
精彩评论