Logo 
Search:

Oracle Articles

Submit Article
Home » Articles » Oracle » Select QueryRSS Feeds

Write a query to Calculate the month difference

Posted By: Harrison Evans     Category: Oracle     Views: 2333

Write a query to Calculate the month difference.

Write a query to Calculate the month difference

SELECT months_between (DOB,SYSDATE) FROM PSTUDENT;

Output : 

MONTHS_BETWEEN(DOB,SYSDATE)
                 -169.3677
                  -174.658
                 -166.1741
                 -175.2064
                 -206.2064
                 -205.2064
                 -165.1741

SELECT months_between ('1-JAN-2003','1-JAN-2002') FROM dual;

Output :

MONTHS_BETWEEN('1-JAN-2003','1-JAN-2002')
                                       12
  
Share: 


Didn't find what you were looking for? Find more on Write a query to Calculate the month difference Or get search suggestion and latest updates.

Harrison Evans
Harrison Evans author of Write a query to Calculate the month difference is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!