Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: View challenge

Re: View challenge

From: <frebe73_at_gmail.com>
Date: 11 Aug 2006 23:34:26 -0700
Message-ID: <1155364466.606132.323690@i3g2000cwc.googlegroups.com>


> I suspect you left out a few details from your question. For instance,
> it appears a natural join on emp_schedule and workshift suffice for your
> view.

In the schedule table you have a column recur_interval that indicates the number of days for which the workshifts should recur. A natural join will only return the first occurrence. For example with the given rows in the tables,

schedule(1, 7)

workshift(1, 1, '2006-08-07 08:00', '2006-08-07 17:00') workshift(1, 2, '2006-08-08 08:00', '2006-08-07 17:00')

employee(1)

emp_schedule(1, 1, '2006-08-07', '2006-08-21')

the view should return

(1, '2006-08-07 08:00', '2006-08-07 17:00')
(1, '2006-08-08 08:00', '2006-08-08 17:00')
(1, '2006-08-14 08:00', '2006-08-14 17:00')
(1, '2006-08-15 08:00', '2006-08-15 17:00')

/Fredrik Bertilsson Received on Sat Aug 12 2006 - 01:34:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US