SyntaxFix
Write A Post
Hire A Developer
Questions
This line solved my same problem in postgresql:
SELECT DATE_PART('year', column_name::date) from tableName;
If you want month, then simply replacing year with month solves that as well and likewise.
year
month