Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
How to delete duplicate rows in SQLI have a table where the data is imported daily with different datesand I have ID's that have more than one row with the same dataPlease help
quote:Originally posted by Julie19 How to delete duplicate rows in SQLI have a table where the data is imported daily with different datesand I have ID's that have more than one row with the same dataPlease help
can you copy and paste a sample of data please to help up help you!--------------------------Get rich or die trying--------------------------
Villanuev
Constraint Violating Yak Guru
478 Posts
Posted - 2012-06-26 : 23:46:34
sample script to delete duplicate records.
delete d from (select *, row_no = row_number() over (partition by esn, shipdate, model_code, supplierid order by esn)from YourTable where ESN='270113179912138090') dwhere d.row_no <> 1