Microsoft
Software
Hardware
Network
Question : SQL Query
I need to write a query to check for duplicates in data..
Columns of table
ItemNumber, ProductNumber, Country, List, Contract, DateCode, Cdate, AddDate, ModifyDate
The conditions for duplicates is that ItemNumber, ProductNumber,Cdate,
Must be unique
I Need to select these records
Answer : SQL Query
try this:
with cte
as
(
select * from (
select ranking = dense_rank() over(partition by itemnumber, productnumber, cdate order by newid()), *
from Pricing
) a
)
delete from cte
where ranking > 1
Random Solutions
Quotation marks and # signs around variable dates and date parts
How to format output of sql statement
How to create a Second Global Address List in exchange 2007
Trusted Sites button greyed out in IE7 for Windows 2003 Terminal Server domain users sessions
Access 2000 Relink front-end to back-end tables using a path supplied by an .ini file
Populate Text box based on combo box
Email Access Report using PDFCreator and Outlook
Merge two pdf documents using Ghostscript
Access MasterPage Function from UserWebControl Referenced from MasterPage
VSTO Merge Module