select count(*),oId from afl_taobao_rate group by oId order by count(*) desc
afl_taobao_rate 里面的oid重复,要求重复只留一条
1.建立临时表
create table tmp as select * from afl_taobao_rate group by oId
2.给临时表加uniqu限制
ALTER TABLE tmp ADD unique(`oId`);
3.备份原始表
alter table afl_taobao_rate rename afl_taobao_rate2
4.将临时表 改为目标表
alter table tmp rename afl_taobao_rate
去除数据表中重复oid并重命名操作
本文介绍了一种方法,通过建立临时表、添加唯一限制、备份原始表并重命名,来解决afl_taobao_rate表中oid重复的问题。
3444

被折叠的 条评论
为什么被折叠?



