T-SQL Fill in Field from Another Table
Posted on 2013-11-07
I have two joined tabled - Courses and Enrollments structured as follows:
I would like to go through the Enrollments table and create/change the name so that if the instance of the enrollment is greater than 0 (the student has taken the course more than once), the Name of the Enrollment would be the Course Name plus the Year and Month the student took the course. For example, if the student took a second instance of Algebra this month, and the instance field was marked as 1, the Name of the Enrollment for that record would be 'Algebra 2013-11'
I'm having a problem wrapping my head around this. Any help greatly appreciated.