I need to get the annual year in ORACLE, but I just know how to get the current date, like this:
SELECT SYSDATE FROM DUAL
Can you manipulate this to get the Year?
I need to get the annual year in ORACLE, but I just know how to get the current date, like this:
SELECT SYSDATE FROM DUAL
Can you manipulate this to get the Year?
The function EXTRACT
allows you to extract the different parts of a field or variable that contains date, time, or a range.
To get the current date, use the EXTRACT(YEAR FROM sysdate)
excerpt, as in the query example:
select EXTRACT(YEAR FROM sysdate) from dual;
Using to_char:
select to_char(sysdate, 'YYYY') from dual;