SQL - Extract month from current date

Revision as of 15:08, 6 October 2019 by Ardaut (talk | changes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

If you want to extract the month of the current date directly, then use CURRENT_TIMESTAMP

SELECT EXTRACT(MONTH FROM CURRENT_TIMESTAMP)

EXTRACT() is a SQL standard function supported by MySQL, Oracle, and PostgreSQL Databases.