mysql删除重复数据

来源:互联网 发布:c .net api编程教程 编辑:程序博客网 时间:2024/05/06 21:42
create table tmptable as select min(id) as tmp from target_table group by userId;

delete from target_table where id not in (select tmp from tmptable);

查询user_id数量大于1的数据信息
select *,count(user_id) from da_bank_base_user where is_valid = 1 group by user_id having count(user_id)>1;
0 0