sql server current year code example
Example 1: current year sql
-- Oracle
SELECT extract(YEAR FROM sysdate) FROM dual; // number
SELECT to_char(sysdate, 'YYYY') FROM dual; // varchar
Example 2: get current year sql
select year(getdate())
-- Oracle
SELECT extract(YEAR FROM sysdate) FROM dual; // number
SELECT to_char(sysdate, 'YYYY') FROM dual; // varchar
select year(getdate())