Imagine a student and multiple professors
A professor has many students
The students go to class at the same time and date.
Table1
ClassName | ProfessorName |StudentsPresent|ClassStartTime |ClassDate |ClassID Philosophy | Stewart |10 |8:00 |01/29/2011 | 1 Philosophy | Kyle |10 |8:00 |01/29/2011 | 1 Religion | Myke |11 |8:30 |01/29/2011 | 2 Religion | Nancy |11 |8:30 |01/29/2011 | 2
How would I go about getting the following result
ClassName | ProfessorName |StudentsPresent|ClassStartTime |ClassDate |ClassID Philosophy | Stewart,Kyle |10 |8:00 |01/29/2011 | 1 Religion | Myke,Nancy |11 |8:30 |01/29/2011 | 2
As we speak I am researching cursors.
Your table seems to be very denormalized. I’ve heard that cursors are a terrible thing within SQL Server and should be avoided if you can. With it how it is, put into a table called Schedule, this is how I might fulfill your request.