Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Nitin Bansal
Starting Member
13 Posts |
Posted - 2008-06-18 : 03:31:20
|
| How to delete duplicate records from table ? Is there any query for that ?I am using SQL 2005. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-18 : 03:49:27
|
Yes.DELETE fFROM (SELECT ROW_NUMBER() OVER (PARTITION BY Col1 ORDER BY Col2 DESC) AS RecID FROM Table1) AS tWHERE RecID > 1 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Nitin Bansal
Starting Member
13 Posts |
Posted - 2008-06-18 : 06:39:08
|
| I am unable to understand your query. Can you please describe me ? I have 10 Columns in my table, and i want when all the col values are matches with the second row then the same row should deleted. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-18 : 07:43:01
|
PARTITION BY more columns...You know you are allowed to open and read about functions and how they are used, in Books Online (the SQL Server help file)? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|