删除表中重复记录大于两条保存两条
发布时间:2021-01-15 09:42:29 所属栏目:MySql教程 来源:网络整理
导读:今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 delete from t_Cht_clm_reg F where F.case_id in (select T.case_id from (select B.* from (select e.*,row_number() over (partition by e.notice_
以下代码由PHP站长网 52php.cn收集自互联网 现在PHP站长网小编把它分享给大家,仅供参考 delete from t_Cht_clm_reg F where F.case_id in ( select T.case_id from ( select B.* from (select e.*,row_number() over (partition by e.notice_id order by e.case_id desc) rn from t_Cht_clm_reg e) B where B.notice_id in( select A.notice_id from (select e.*,row_number() over (partition by e.notice_id order by e.case_id desc) rn from t_Cht_clm_reg e) A group by A.notice_id having count(A.notice_id) > 2 ) ) T where T.RN > 2 ) 以上内容由PHP站长网【52php.cn】收集整理供大家参考研究 如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。 (编辑:ASP站长) 【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。 |
相关内容
未处理完善
-
无相关信息
最新更新