Hello All!
Is this possible and if so, how?
I have 2 tables a Lessons table and an Assignments table. Each Lesson has multiple Assignments. The previous years' Lessons and Assignments need to be copied with the new school year of 2009. I was successfully able to copy the previous year's information with the school year of 2009. However, on the Assignment side, after I copied 2008 info., it now contains the lesson id of 2008 which is a foreign key in my Assignments table(assign_less_id).
I have a select statement that looks like this:
SELECT * FROM LESSONS AS a INNER JOIN ASSIGNMENTS AS b ON a.lesson_schlyr=b.assignment_schlyr WHERE a.lesson_schlyr = '2009' AND b.assignment_schlyr = '2009' ORDER BY a.lesson_id, b.assign_less_id
I need that each time the old lesson id on the Assignments table (assign_less_id) changes to assign the next new Lesson Id for 2009.
Oh, I don't know if I am explaining myself clearly enough.
Please Help!
Lladros
Is this possible and if so, how?
I have 2 tables a Lessons table and an Assignments table. Each Lesson has multiple Assignments. The previous years' Lessons and Assignments need to be copied with the new school year of 2009. I was successfully able to copy the previous year's information with the school year of 2009. However, on the Assignment side, after I copied 2008 info., it now contains the lesson id of 2008 which is a foreign key in my Assignments table(assign_less_id).
I have a select statement that looks like this:
SELECT * FROM LESSONS AS a INNER JOIN ASSIGNMENTS AS b ON a.lesson_schlyr=b.assignment_schlyr WHERE a.lesson_schlyr = '2009' AND b.assignment_schlyr = '2009' ORDER BY a.lesson_id, b.assign_less_id
I need that each time the old lesson id on the Assignments table (assign_less_id) changes to assign the next new Lesson Id for 2009.
Oh, I don't know if I am explaining myself clearly enough.
Please Help!
Lladros