DELETE FROM dups a USING ( SELECT MIN(ctid) as ctid, key FROM dups GROUP BY key HAVING COUNT(*) > 1 ) b WHERE a.key = b.key AND a.ctid <> b.ctid
Powered by: 博客园 Copyright © 2024 且行且思 Powered by .NET 9.0 on Kubernetes