0% found this document useful (0 votes)
25 views1 page

Functions

The document contains SQL queries that demonstrate various date functions in a database. It shows the current date, calculates future dates, and finds the difference in months between two dates. The results indicate specific dates and the number of months between given dates.

Uploaded by

G Ravi Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Functions

The document contains SQL queries that demonstrate various date functions in a database. It shows the current date, calculates future dates, and finds the difference in months between two dates. The results indicate specific dates and the number of months between given dates.

Uploaded by

G Ravi Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

select sysdate from dual;

SYSDATE
29-JAN-25
1 rows retu

select add_months(sysdate,1) from dual;

ADD_MONTHS(SYSDATE,1)
28-FEB-25

select current_date from dual;

CURRENT_DATE
29-JAN-25

select next_day(sysdate,'monday') from dual;

NEXT_DAY(SYSDATE,'MONDAY')
03-FEB-25

select last_day(sysdate) from dual;

LAST_DAY(SYSDATE)
31-JAN-25
select months_between('16-april-2020','16-june-2021') from dual;

MONTHS_BETWEEN('16-APRIL-2020','16-JUNE-2021')
-14
select months_between('16-april-2020','16-jan-2021') from dual;

MONTHS_BETWEEN('16-APRIL-2020','16-JAN-2021')
-9

You might also like