MySQL Forums
Forum List  »  Newbie

Help with SQL statement
Posted by: Fergal O'Hanlon
Date: March 23, 2005 08:00AM

Hi

I would be grateful if someone could answer the following for me.

I have a table called details with contains a RecordID, TrainerID, Course and Date field

For example:

RecordID TrainerID Course Date
1 1 Performance 2005-04-03
2 1 Performance 2005-04-04
3 1 Performance 2005-04-05
4 2 MBTI 2005-04-11
5 2 MBTI 2005-04-12
6 1 Performance 2005-04-20
7 1 Performance 2005-04-21

What the above example contains are 3 courses with a date for each course. For first course Performance by TrainerID 1 runs from 03 - 05 of April 2005. Unfortunately the table should really have a start and and end date field but I have to deal with waht I got. It only have one date field so is a course is run for 10 day period then 10 entires are added to the database.

Is there a mysql statement which will allow me to select each course for each trainerid by the first occurance to the last occurance of that course and to also then give me the start date and the end date.

Any help is very much apprecaited.

Thanks,

Fergal.

Options: ReplyQuote


Subject
Written By
Posted
Help with SQL statement
March 23, 2005 08:00AM
March 23, 2005 04:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.