在论坛上看到,抛哥写的
面试看到这种题。。。。。
我估计考官的正确答案有可能是错的
所以你用了下面这个方式
虽然可用但只会得0分。
delete c from t_people as c ,t_people d
where c.name = d.name and c.id <> d.id
;
mysql 可用
所以在这里记录一下,我们是如何处理这类问题的
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博客 ” ,链接:http://blog.itpub.net/13726712/viewspace-684181/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13726712/viewspace-684181/