Home Forums SQL Server 2005 T-SQL (SS2K5) Looking For Duplication RE: Looking For Duplication
ss-457805
SSCertifiable
Points: 5872
More actions
July 24, 2009 at 6:59 am
#1029629
i think u needed the recordid as well,,,
with CTE
as
(
select *, ROW_NUMBER() over (PARTITION by productid,productclass,producttype,orderdate order by orderdate) as rn
from tmpOrders
)
select * from CTE where rn>1;