﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / Deleting duplicates rows / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 15:55:29 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Deleting duplicates rows</title><link>http://www.sqlservercentral.com/Forums/Topic1421949-392-1.aspx</link><description>[code="sql"]DROP table #emplCREATE TABLE #empl(	row_id int,	ename varchar(120),	job varchar(120),	sal varchar(100))INSERT #empl VALUES 	('4','ram','IT','60000'), 	('4','ram','IT','60000'), 	('4','ram','IT','60000'), 	('4','ram','IT','60000');WITH OrderedData AS (	SELECT row_id, ename, job, sal,		rn = ROW_NUMBER() OVER(PARTITION BY row_id, ename, job, sal ORDER BY row_id, ename, job, sal)  	FROM #empl) DELETE OrderedData WHERE rn &amp;gt; 1SELECT * FROM #empl[/code]</description><pubDate>Wed, 20 Feb 2013 00:54:25 GMT</pubDate><dc:creator>ChrisM@Work</dc:creator></item><item><title>RE: Deleting duplicates rows</title><link>http://www.sqlservercentral.com/Forums/Topic1421949-392-1.aspx</link><description>This should help you out[code="sql"]; WITH cte_Delete_Dups AS(	SELECT	ROW_NUMBER() OVER ( PARTITION BY row_id, ename, job, sal ORDER BY row_id ) AS RN, *	FROM	empl)DELETEFROM	cte_Delete_DupsWHERE	rn &amp;gt; 1[/code]</description><pubDate>Wed, 20 Feb 2013 00:48:09 GMT</pubDate><dc:creator>Kingston Dhasian</dc:creator></item><item><title>Deleting duplicates rows</title><link>http://www.sqlservercentral.com/Forums/Topic1421949-392-1.aspx</link><description>hai friends,      i m created one table ,i wanna delete the duplicate valuescreate table empl(row_id  int,ename   varchar(120),job   varchar(120),sal varchar(100))insert into empl ('4','ram','IT','60000')insert into empl ('4','ram','IT','60000')insert into empl ('4','ram','IT','60000')insert into empl ('4','ram','IT','60000')i am write the query to delete duplicatesdelete from empl t where t.ename&amp;gt;(select min(t1.ename) from empl t2 where t.job=t2.job and t.sal=t2.sal)but its was showimg error  "Incorrect syntax near 't'." like dis  do the need full</description><pubDate>Wed, 20 Feb 2013 00:31:19 GMT</pubDate><dc:creator>raghuldrag</dc:creator></item></channel></rss>