sql - Condition for current time greater than or equal to from time and current time less than or equal to time in ORACLE -


condition not working because using to_char(),but how extract time? following query:

select *   supply_timing  to_char (sysdate, 'hh:mi') >= to_char (from_time, 'hh:mi')        , to_char (sysdate, 'hh:mi') <= to_char (to_time, 'hh:mi') 

it looks interested in time not in date part. assuming data type of from_time , to_time date or timestamp can this:

select * supply_timing extract(hour sysdate) + extract(minute sysdate)/60     between extract(hour from_time) + extract(minute from_time)/60        , extract(hour to_time) + extract(minute to_time)/60 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -