WITH cte AS (
SELECT [ITEMID]
,[PURCHPRICE]
,[RETAILAMDISCOUNTTYPE]
,[CURRENCYCODE]
,[PURCHDISCPERCENT]
,[SALESPRICE]
,[VENDACCOUNT]
,[FROMDATE]
,[TODATE]
,[RETAILPRICECHANGESTATUS]
,[GROUPID] ,
row_number() OVER(PARTITION BY [ITEMID]
,[PURCHPRICE]
,[RETAILAMDISCOUNTTYPE]
,[CURRENCYCODE]
,[PURCHDISCPERCENT]
,[SALESPRICE]
,[VENDACCOUNT]
,[FROMDATE]
,[TODATE]
,[RETAILPRICECHANGESTATUS]
,[GROUPID] order by [ITEMID] ) AS [rn]
FROM [RETAILPRICECHANGETABLE]
)
DELETE cte WHERE [rn] > 1
0stupodgraphsa-1999 Robert Cruz https://wakelet.com/wake/7HFwDc5YfnfWZPEEfmnks
ReplyDeleteopcesvina