get year in sql code example
Example 1: get current year sql
select year(getdate())
Example 2: print year of a date sql
SELECT EXTRACT(YEAR FROM CURRENT_DATE)
Example 3: sql convert datetime to year
select YEAR(getdate())
/* 2020 */
select year(getdate())
SELECT EXTRACT(YEAR FROM CURRENT_DATE)
select YEAR(getdate())
/* 2020 */