Home » SQL & PL/SQL » SQL & PL/SQL » How to avoid ovelapping dates
How to avoid ovelapping dates [message #355514] Fri, 24 October 2008 10:43 Go to next message
Messages: 1
Registered: October 2008
Junior Member
I have a master detail table for employee absence entry.
The master table has columns like empno,name,hiredate
the detail table has columns like absence type, date_start,date_end

an employee can have data like this
Leave_type date_start Date_end
Sick leave 01-jan-2008 05-jan-2008
Earned leaves 15-jan-2008 18-jan-2008
casual Leave 15-feb-2008 25-feb-2008
i just want to avoid this
Sick leave 20-feb-2008 28-feb-2008

As this new leave is overlapping the casual leave period or the employee has already taken a leave from 15th feb 2008 to 25-feb-2008 so he can no take a new leave in the same duration.
Hope this will help in getting the probelm.
Re: How to avoid ovelapping dates [message #355516 is a reply to message #355514] Fri, 24 October 2008 10:55 Go to previous messageGo to next message
Michel Cadot
Messages: 65146
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Post a test case: create table and insert statements along with the result you want with these data.

Re: How to avoid ovelapping dates [message #355530 is a reply to message #355516] Fri, 24 October 2008 13:10 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Previous Topic: Search the whole user
Next Topic: What update index does?
Goto Forum:

Current Time: Mon Aug 21 07:16:18 CDT 2017

Total time taken to generate the page: 0.02252 seconds