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
Why does MS SSRS 2005 Hang On Query?
C++ - Calling 'RegDeleteValue' in between 'RegEnumValue' causes 'RegEnumValue' to fail
Can't Find UDF
Windows home server - a quick tutorial please?
Putting Circle or Bracket, around the correct answer in a Report.
SQL: Invalid object name 'tablename'
Referential Integrity and Constraint Question
Calculate values on a form from a sub form
Problem with asp include file
I just wanted to check that the file type 'trn' is used for transaction log backups?