View challenge
From: <frebe73_at_gmail.com>
Date: 11 Aug 2006 03:49:46 -0700
Message-ID: <1155293386.004905.268130_at_h48g2000cwc.googlegroups.com>
I have a number of tables as below:
employee(*employeeid, ....)
schedule(*scheduleid, recur_interval, ...) emp_schedule(*employeeid, *scheduleid, *valid_from, valid_to) workshift(*scheduleid, *shiftid, starttime, endtime)
endtime
.....
Date: 11 Aug 2006 03:49:46 -0700
Message-ID: <1155293386.004905.268130_at_h48g2000cwc.googlegroups.com>
I have a number of tables as below:
employee(*employeeid, ....)
schedule(*scheduleid, recur_interval, ...) emp_schedule(*employeeid, *scheduleid, *valid_from, valid_to) workshift(*scheduleid, *shiftid, starttime, endtime)
recur_interval indicates the number of days for which the schedule
should recur.
starttime and endtime indicates the first occurrence of the workshift.
Now I want to create a view (without using stored procedure) that returns every occurrence of the workshifts for every employee, like below.
create view emp_calendar as
select
employeeid,
starttime,
endtime
.....
Does someone has a solution (preferably MySQL) for this, or is it simply impossible?
Fredrik Bertilsson Received on Fri Aug 11 2006 - 12:49:46 CEST