我需要从表中删除重复项:" `: @1 `2 U [7 ]* a- C- p
;WITH cte as(SELECT ROW_NUMBER() OVER (PARTITION BY [specimen id] ORDER BY ( SELECT 0 ) RN FROM quicklabdump) delete from cte where RN>1该列quicklabdumpID是主键。 7 Y4 L' L+ p! J8 F4 e2 W我想知道该怎么办quicklabdumpID在多次发生的情况下,只保留最大的[specimen id] ( l# R- N3 p7 ?4 ~4 n$ s " l( U' b' e- j: ~2 r2 H解决方案: * w! V) d' Y# J+ R( A7 p
更改订单quicklabdumpid DESC。9 b* S' _+ L) V7 ~- t' K
WITH cte as( SELECT ROW_NUMBER() OVER (PARTITION BY [specimen id] ORDER BY quicklabdumpid DESC ) RN FROM quicklabdump)delete from cte where RN>