oracle sql difference between two dates code example
Example 1: oracle difference between two dates in years
select floor(months_between(date '2012-10-10', date '2011-10-10') /12) from dual;
select floor(months_between(date '2012-10-9' , date '2011-10-10') /12) from dual;
Example 2: oracle difference between two dates in days
v_numvar := dt1-dt2;