So I work for a university and I'm trying to get our enrollment process correct for our learning management system for students who add and drop classes. The problem I'm experiencing is when a student drops a particular class and then re-adds the same class the ERP system we use inserts a row for each add and drop. So the student originally adds the class say on 3/2 but then drops the later class on 3/2, this is one row. Now the student needs to add that same class back, this would be another row. Here is a quick sample I hope makes sense. I'm trying to figure out the SQL syntax to accomplish this.
id year term seqNum course add_date drop_date
21 1920 SP 5 PM510-50 2020-03-02 19:31:19.000 2020-03-02 19:35:48.000
21 1920 SP 8 PM510-50 2020-03-02 19:38:19.000 NULL