刪掉表里個字段重復行數據(重復主鍵數據)
發布時間:2025/2/11 0:50:50 作者:Admin 閱讀:8
廣告:
WITH CTE AS ( SELECT *, ROW_NUMBER() OVER(PARTITION BY PK_MESSAGE ORDER BY sendtime desc) AS rn FROM sm_msg_approve_2025 ) DELETE FROM CTE WHERE rn > 1;
PK_MESSAGE 為重復主鍵數據
廣告:
相關文章