I have a legacy table: Students in my database (SQL-Server) as below:
STUDENTID - SURNAME - FORENAME
DJ1 Doe John
DJ1 Doe John
DJ2 Doe Jane
DJ2 Doe Jane
DJ1 Dark Odin
AS1 Tom Layton
....
It is expected to have duplication in my table like in the case of John Doe or Jane Doe. I don't want that to be treated as a duplicate data. What I want to avoid is actually having different student sharing the same STUDENTID
(e.g. Odin Dark and John Doe).
How do I create a query that return the student with different name sharing the same STUDENTID
?
So My Query will return something like this:
ID - Surname - Forname
DJ1 Doe John
DJ1 Dark Odin
Thanks in advance.