--Table Creation Query
CREATE TABLE EmployeeMas
(Firstname varchar(10),
)
--Insert Query
insert into EmployeeMas(Firstname) Values ('DotNet');
insert into EmployeeMas(Firstname) Values ('DotNet');
insert into EmployeeMas(Firstname) Values ('DotNet');
insert into EmployeeMas(Firstname) Values ('DotNet');
insert into EmployeeMas(Firstname) Values ('DotNet');
insert into EmployeeMas(Firstname) Values ('DotNet');
--Select All Rows
Select * From EmployeeMas
--Delete Query
With Cte(Rownum)
AS(
Select Row_Number() Over (Partition by Firstname Order by Firstname) As Rownum From EmployeeMas)
Delete From Cte Where Rownum>1
--Again Select all rows
Select * From EmployeeMas