数据去重

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
))

posted @ 2022-06-29 17:29  不再犯错  阅读(34)  评论(0)    收藏  举报