I have a holidays table for a person, say 'M109'. for a particular date he taken vacation for 1 hour lunch and 4 hour meeting.
eg.
- 11 am to 3 pm - meeting
- 12pm to 1pm - lunch.
now I need to hide this 1 hour lunch tuple and get only the meeting tuple. how can i do that ?
table(Person(varchar), StartTime, EndTime, Date, Desciption)
is the schema.
My query so far:
select "Provider", sum(b."EndTime" - b."StartTime")/60 as Non
from VACATION b
where b."StartDate" = '18-FEB-13'
and b."StartTime" IN (select p."StartTime"
from axium.VACATION p
where Exists (select q."StartTime"
from axium.VACATION q
where p."Provider" = q."Provider"
and q."StartTime" <> p."StartTime"
and q."StartTime" between p."StartTime"
and p."EndTime"
)
)
and b."Provider" = 'M1009'
group by b."Provider"
order by b."Provider";