We have a table that is setup with an (auto Increment) ID, ClassID, StudentID. The class id is for the class that the student is taking. Sometimes our system creates duplicates of the same student in the same class. We are currently trying to fix that problem. It might have to do with hitting the back button.
Students will often take the next class so we don't want to delete duplicates of students. We want to delete duplicate students that are contained in the same classID.
For example:
ID | ClassID | StudentID
1 | 1 | 1
2 | 2 | 1
3 | 2 | 1
4 | 2 | 2
5 | 2 | 2
I want to delete IDs 3 and 5. I have searched the Internet for this answer and can't seem to find it. The best that I've found is grouping but how do I group each class id and find duplicates within each classID grouping?