Werbung / Advertisements

SQL Date Functions

SQL
Werbung / Advertisements

The SQL code to get the first day of the current year using Oracle SQL:

SELECT TRUNC(SYSDATE,'YEAR')
FROM DUAL;

The SQL code to get the first day of the current month using Oracle SQL:

SELECT TRUNC(SYSDATE, 'MON') 
FROM DUAL;

Current year (extract from SYSDATE) using Oracle SQL:

SELECT EXTRACT(YEAR FROM SYSDATE) AS YearNumber
FROM DUAL;

Get the first Monday in the following Month using Oracle SQL:

SELECT NEXT_DAY(LAST_DAY(SYSDATE + 1), 'MONDAY')
FROM DUAL;
Werbung / Advertisements

Blogofant

Betreiber mehrere Webseiten, Autor, Student und vieles mehr!

You may also like...

Werbung / Advertisements