• Sergiy,

    I apologize for overlooking that detail of your script. Your script does identify the names with a duplicate entry by isolating the "known" ID values from the "unknown" ID values; however, I think the main intent of the original request was to filter out the duplicates, not to identify them, except perhaps by the "sort" column to indicate that a matching duplicate was identified by means of the T1 or T3 column.

    The intent of the query solution I supplied is to yield a list of names with no identifiable duplicates in the list. If there are duplicate entries of the same student, it is only because neither the T1 nor the T3 columns matched up to supply a definite identification of the duplicate entry.

    If I misconstrued the intent of the original post, and the goal is to identify duplicates rather than to suppress them, then your solution is likely a better one for this thread.

    Come to think of it, there does seem to be a mixing up of "filtering" duplicates and "identifying" them at one and the same time. If so, these tasks are at cross purposes because by definition eliminating duplicates means removing from the results the very rows that are needed in order to identify the duplicates and ultimately to eliminate them from the underlying data.