I have a query that runs multiple times a day, the issue though is we want the query to only return result when it’s run at certain times. So for this example I only want records to be returned when the query is run during the 8am hour. I thought this might work
case
when to_char(sysdate,'HH24') = '08' then
select
*
from
tablename
end
And indeed it does during the 8am hour, but outside of that it errors rather than returning no records.
Any ideas?
Okay well that was dumb of me. I was WAY over thinking it. I was stuck on having to use a if then sort of condition. Time for more coffee.
Perhaps: