在论坛上看到,抛哥写的
select * from (
select t.*, row_number() over(PARTITION BY BUNDLE_ID ORDER BY BUNDLE_ID ) rn
from bb_t t where bundle_kind=3 and service_kind=14
and if_valid =1 )
where rn = 1
或者
delete from cm_month_t where rowid not in (
select max(t1.rowid) from cm_pt_month_user_t t1 group by t1.f_service_id,t1.f_service_kind,t1.f_part_city);
commit;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13726712/viewspace-684181/ ,如需转载,请注明出处,否则将追究法律责任。