Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between two dates

CostaAug 17 2012 — edited Aug 17 2012
I have two tables master and market
of which market contain three variables like sale start_date, stop_date and duration (difference between start and stop date). I want to retrieve those data
where difference between start and stop date is not matching with duration.
start_date stop_date duration
13-JAN-2012 14-JAN-2012 1 day
18-JAN-2012 18-MAR-2012 3 month
22-APR-2012 22-APR-2012 1 month
09-JUL-2011 09-JUL-2012 365 days
18-JAN-2012 18-MAR-2012 59 days
select a.start_date,a.stop_date,a.duration
from master b, market a
where a.number=b.number
and start_date is not null and stop_date is not null
and duration is not null
and stop_date-start_date=duration
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2012
Added on Aug 17 2012
12 comments
239 views