Try something like this. It gets the current timestamp first, and cross-joins your query to it. The optimizer will be smart enough to see that "A
" doesn't have any rows, and won't run "B
".
SELECT B.*
FROM (SELECT CURRENT TIME AS CTIME FROM SYSIBM.SYSDUMMY1) A
JOIN (...your_query...) B
ON 1=1
WHERE A.CTIME BETWEEN '08:00:00' AND '09:00:00'