Question: How can I display the difference
between two dates?
I want to display the difference between dates, formatted to show
the difference in years, months and days.
Answer: One simple way to display the
difference between dates is to convert an elapsed time into rounded
In this example of displaying date differences, we have a Oracle
logoff trigger that computes the elapsed session time and places it
inside a table:
user = user_id
elapsed_minutes is NULL;
Here is the Oracle SQL query to get the list of dates for the day
between the 2 dates, and the difference between the dates.
3 SYSDATE - 1 Yesterday,
4 SYSDATE + 1 Tomorrow
--------- --------- ---------
Get the Complete
Oracle SQL Tuning Information
The landmark book
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
for 30% off directly from the publisher.