Remove duplicate rows select * from temp1
declare @duplikate table (ID int NOT NULL,Name varchar,Age int,city varchar);
with duplikate as (
SELECT ID,Name,Age,city,
row_Number () Over (partition by Name,Age,city order by Name)
as RowNumber
FROM Temp1
)
delete from duplikate where RowNumber >=2