We can find the day using DAY function, month using MONTH function and year using YEAR function from a date.
It takes the date() as a parameter and returns a value in the date data type.
Let’s make an example for a better understanding of these functions.
Find the day, month and year of a date:
1 2 3 |
SELECT DAY('2019-12-16') AS day_of_date, MONTH('2019-12-16') AS month_of_date, YEAR('2019-12-16') AS year_of_date; |