SQL query for extracting year from a date

前端 未结 5 908
忘了有多久
忘了有多久 2021-02-04 12:17

I am trying to create a query that gets only the year from selected dates. I.e. select ASOFDATE from PSASOFDATE; returns 11/15/2012, but I want only

5条回答
  •  执念已碎
    2021-02-04 12:32

    SELECT date_column_name FROM table_name WHERE EXTRACT(YEAR FROM date_column_name) = 2020

提交回复
热议问题