mysql去重
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 oId2.给临时表加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
相关推荐
阿亮 2019-10-24
暗夜之城 2019-08-02
javashixisheng 2019-05-28
hyfound 2018-07-14
vimysql 2019-04-15
ApacheMySQL 2019-04-14