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 |
|
Anand.A
Posting Yak Master
109 Posts |
Posted - 2011-12-03 : 01:46:49
|
| hii am having table iestudent_id student_nm student_date1 john 12-09-892 rina 23-08-780 ---- 00-00-000 ---- 00-00-00so how i can delete this duplicate record in sql server 2008anand |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-03 : 01:48:31
|
| [code]delete tfrom (select row_number over (partition by student_id,student_date order by newid()) as rnfrom table)twhere rn >1[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Anand.A
Posting Yak Master
109 Posts |
Posted - 2011-12-03 : 02:21:10
|
| ya thanks for ur replybut i got error "Incorrect syntax near the keyword 'over'."anand |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-03 : 02:22:59
|
missed ()delete tfrom (select row_number() over (partition by student_id,student_date order by newid()) as rnfrom table)twhere rn >1 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Anand.A
Posting Yak Master
109 Posts |
Posted - 2011-12-03 : 02:27:41
|
| ya thanksanand |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-03 : 02:32:13
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
jassi.singh
Posting Yak Master
122 Posts |
Posted - 2011-12-03 : 09:32:12
|
| Hi,Please check below link. Same thing is explained very nicely. Worth reading.http://support.microsoft.com/kb/139444How to remove duplicate rows from a table in SQL Server |
 |
|
|
|
|
|