I have two tables like so:
EventTable (EID, Name, EventTime)
VideoTable (VID, StartTime, Video, DurationSecs)
The EventTable contains events that occur at a particular time.
The VideoTable contains a list of video files and their starting times.
What I would like to return is a list of all events and the correct video file (and hopefully time into the video file) for each event.
Consider the following data:
EventTable
1, EV1, 2010-01-01 12:00:00
2, EV2, 2010-01-01 12:15:00
3, EV3, 2010-01-01 12:30:00
VideoTable
1, 2010-01-01 11:30:00, A.mpg, 2700
2, 2010-01-01 12:15:00, B.mpg, 2700
3, 2010-01-01 13:00:00, C.mpg, 1800
The return list would be as follows:
EV1, A.mpg, 1800 (secs)
EV2, B.mpg, 0 (secs)
EV3, B.mpg, 900 (secs)
How could i acheive this?
EDIT
The Time columns are DATETIME types. There is no relationship between EID and VID. The duration column specifies the video duration in seconds.
1 Answer