--Creating TableCreate Table Ex (productno int, productname NVarchar(20), des NVarchar(20), quantity int ) --Inserting Sample Data Insert Into Ex Values(1, 'borin', '4x-mal', 2)Insert Into Ex Values(1, 'borin', '5x-cal', 3)Insert Into Ex Values(2, 'hypoid', '4-5cal', 4)Insert Into Ex Values(2, 'hypoid', '4-5cal', 4)
;With CTE As ( Select *, ROW_NUMBER() Over (Partition By productno, productname Order By Productno) As rn From Ex ) Delete From CTE Where rn = 2