Hi, I have one studentinfo table with the fields of
Id, studentID, ExamDate, Service, Age, CPTID, ICDID
In my database, I have some almost duplicate records with only different CPT codes like the following
Id, PatientID, ExamDate, Service, PatAge, CPTID, ICDID
1 91959954 2005-07-09 20 39 92060 378.9
2 91959954 2005-07-09 20 39 99213 378.9
3 187093 2005-01-06 6 26 92016 743.2
4 67206 2005-01-06 270 72 92012 371.6
In this case, record 1 and record 2 have the same data except the CPTID, thus I know this is the same student doing the same exam. Then what I need to do is to merge these two records and insert his info to a new table with the fields of
Id, studentID, ExamDate, Service, Age, CPTID1, CPTID2, ICDID
Any thoughts on how to do this?