Logo 
Search:

Oracle Articles

Submit Article
Home » Articles » Oracle » Select QueryRSS Feeds

Write a query to calculate the Date difference

Posted By: Adriane Miller     Category: Oracle     Views: 2982

Write a query to calculate the Date difference.

Write a query to  Calculate the Date difference

SELECT SYSDATE - DOB FROM PSTUDENT;

Output : 

SYSDATE-DOB
 5156.3947
 5316.3947
 5058.3947
 5332.3947
 6275.3947
 6246.3947
 5028.3947

SELECT ROUND((SYSDATE-DOB)/30) FROM PSTUDENT;

Output : 

ROUND((SYSDATE-DOB)/30)
                   172
                  177
                      169
                   178
                   209
                   208
                   168

SELECT ROUND((SYSDATE-DOB)/365) FROM PSTUDENT;

Output : 

ROUND((SYSDATE-DOB)/365)
                     14
                     15
                     14
                     15
                     17
                     17
                     14
  
Share: 


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

Adriane Miller
Adriane Miller author of Write a query to calculate the Date difference is from Frankfurt, Germany.
 
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!