常用sql总结

删除表中重复数据,只保留一条最新记录

DELETE FROM TABLE A
WHERE A.CREATEDATE < (SELECT MAX(B.CREATEDATE) FROM TABLE B WHERE A.CUSTOMER_GUID=B.CUSTOMER_GUID);

你可能感兴趣的:(数据库)