Exercise: Extract Year and Month
Get year and month from a date.
Solution
sql
1SELECT
2 STRFTIME('%Y', '2024-03-15') AS year,
3 STRFTIME('%m', '2024-03-15') AS month;
Get year and month from a date.
1SELECT
2 STRFTIME('%Y', '2024-03-15') AS year,
3 STRFTIME('%m', '2024-03-15') AS month;