我目前有这个:
DELETE FROM t
FROM (
SELECT
*
, rn = ROW_NUMBER() OVER (
PARTITION BY Street, CAST(PC AS CHAR(4))
ORDER BY CAST(PC AS CHAR(4))
)
FROM Locals where DATALENGTH(PC) < 13
) t
WHERE rn > 1
但我只想在PC
列相同时删除。