其他分享
首页 > 其他分享> > 数据去重

数据去重

作者:互联网

delete from xx   where smokevehicleid not in (
select t.max_id from
(select max(smokevehicleid) as max_id from xxx group by smokeno) as t
);

delete from xxx  a where a.SmokeNo in (select SmokeNo from xxx where smokevehicleid not in (
select t.max_id from
(select max(smokevehicleid) as max_id from xxx  group by smokeno) as t
))

标签:max,xxx,smokevehicleid,where,数据,id,select
来源: https://www.cnblogs.com/luoguixin/p/16424300.html