I have a table with 526 rows and has lot of duplicate data. For removing duplicate I used this script:
select distinct fullname, RegistrationNumber
from tbllookupStudentInfo1;
I got 291 rows, but it still has duplicate column so I tried using union:
select distinct fullname, RegistrationNumber
from tbllookupStudentInfo1
union
select fullname,RegistrationNumber
from tbllookupStudentInfo1;
I got 291 rows, but still I am getting few duplicate value. And then I select just Fullname using both union and distinct and got 213 rows which consists few duplicate fullname too. How should I solve this?
question from:
https://stackoverflow.com/questions/65643343/distinct-or-union-is-selecting-duplicate-data-in-sql-server 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…