One use case that happens often in SQL is the need to retrieve today’s date. This could be you are doing an analysis based on recent data, or it could be you are building a script that needs to retrieve the date dynamically.
Unfortunately there is no standard SQL that allows you to retrieve today’s date across different database systems. So in this post we have gathered the SQL statement needed to retrieve today’s date for the most popular database systems:
SELECT SYSDATE FROM DUAL;
SELECT current date FROM sysibm.sysdummy1;
SELECT CURRENT_DATE or SELECT CURRENT_DATE();