Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Name TimeIn TimeOut
- Bob 2012-07-17 07:00:00.000 2012-07-17 16:00:00.000
- Sam 2012-07-17 10:00:00.000 2012-07-17 20:00:00.000
- Beatly 2012-07-17 14:00:00.000 2012-07-17 23:00:00.000
- Mac 2012-07-17 21:00:00.000 2012-07-18 07:00:00.000
- Name TimeIn TimeOut
- Fred 2012-07-17 15:59:00.000 2012-07-18 00:19:00.000
- DirName HelperStart HelperEnd
- Bob 2012-07-17 15:59:00.000 2012-07-17 16:00:00.000
- Sam 2012-07-17 15:59:00.000 2012-07-17 16:00:00.000
- Beatly 2012-07-17 15:59:00.000 2012-07-17 16:00:00.000
- Sam 2012-07-17 16:01:00.000 2012-07-17 20:00:00.000
- Beatly 2012-07-17 16:01:00.000 2012-07-17 20:00:00.000
- Beatly 2012-07-17 20:01:00.000 2012-07-17 21:00:00.000
- Beatly 2012-07-17 21:01:00.000 2012-07-17 23:00:00.000
- Mac 2012-07-17 21:01:00.000 2012-07-17 23:00:00.000
- Mac 2012-07-17 23:01:00.000 2012-07-18 00:19:00.000
- select d.name as DirectorName, h.name as HelperName,
- (case when d.timeIn > h.timeIn then d.timeIn else h.timeIn end) as HelperStart,
- (case when d.timeOut > h.timeOut then h.timeOut else d.timeOut end) as HelperEnd
- from director d join
- helper h
- on d.timeIn < h.timeOut and
- d.timeOut >= h.timeIn
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement