Re: View challenge
- From: Bob Badour <bbadour@xxxxxxxxxxxxxxxx>
- Date: Fri, 11 Aug 2006 13:45:15 GMT
frebe73@xxxxxxxxx wrote:
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?
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.
.
- Follow-Ups:
- Re: View challenge
- From: frebe73
- Re: View challenge
- References:
- View challenge
- From: frebe73
- View challenge
- Prev by Date: Re: Why bother with Logical data model?
- Next by Date: Re: Why bother with Logical data model?
- Previous by thread: View challenge
- Next by thread: Re: View challenge
- Index(es):
Relevant Pages
|
Loading