create table Temp (Id int IDENTITY(1,1),FirstName varchar(50),Description varchar(50) )
insert into Temp(FirstName,Description) Values('name4','dept4')
select * from Temp
WITH DuplicateRecords AS ( SELECT *,row_number() OVER(PARTITION BY FirstName,Description ORDER BY FirstName) AS RowNumber FROM Temp ) Delete FROM DuplicateRecords WHERE RowNumber>1
SELECT DISTINCT * INTO TempTable FROM Temp GROUP BY FirstName,Description,Id HAVING COUNT(FirstName) > 1 select Temp WHERE FirstName IN (SELECT FirstName FROM TempTable) DELETE Temp WHERE FirstName IN (SELECT FirstName FROM TempTable) INSERT Temp SELECT * FROM TempTable DROP TABLE TempTable
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: