I'm surprised this question hasn't been asked. I must be missing something very obvious here, and I'm prepared for all the down votes and the 3 second answer.
In MSSQL you're able to call GETDATE()
without having to depend on a database table but in Oracle SYSDATE
has to come from DUAL. Is there no way to get the current date in Oracle without having to go through DUAL?
EDIT
Clearly, this doesn't have much to do with SYSDATE
but more with my incorrect usage of it. See the following WHERE clause:
WHERE (extract(YEAR from ORDER_DATE) = (case when extract(month from SYSDATE()) < 11 then extract(year from SYSDATE()) else extract(year from SYSDATE())+1 end)
The above will not work, and from the answers here it seems that adding dual in there is not recommended. What's the most optimal solution here?