T
taibu
Unregistered / Unconfirmed
GUEST, unregistred user!
有以下三个表<br>Table1(保存所有班次时间)<br>Autoid StartTime EndTime<br>1 07:30 19:30<br>2 08:00 20:00<br><br>Table2(所有员工每天对应的班次ID,Employeeid为每次员工对应员工表Employee的ID号)<br>Autoid Employeeid CurDate ClassId<br>1 20 2008-02-01 1<br>2 24 2008-02-01 2<br>3 20 2008-02-02 2<br>4 20 2008-02-03 1<br>5 20 2008-02-04 2<br>6 20 2008-02-05 2<br>7 30 2008-02-02 1<br>8 30 2008-02-10 2<br><br>Table3(保存所有员工的出差记录)<br>Autoid Employeeid StartTime EndTime<br>1 20 2008-01-28 08:00:00 2008-02-10 08:00:00<br>2 30 2008-02-02 08:00:00 2008-02-02 20:00:00<br>3 30 2008-02-02 10:30:00 2008-02-02 14:00:00<br><br>我想通过以上三个表,得出每个员工每天的出差开始时间与结束时间.<br>例如,我得出2008-02-01到2008-02-03之间每个员工每天的出差时间明细,如下:<br>Table4(所求表,)<br>Employeeid CurDate StartTime EndTime<br>20 2008-02-01 07:30:00 19:30:00<br>20 2008-02-02 08:00:00 20:00:00<br>20 2008-02-03 07:30:00 19:30:00<br>30 2008-02-02 10:30:00 14:00:00<br><br>请各位高手帮帮出出主意,如何才能以最快速度得出TABLE4呢?