mysql重复数据
发布时间: 2023-11-07 05:34:43
⑴ Mysql根据一张表俩个字段删除重复数据
如果你需要的是删除数据库中的数据:
delete from table a
where (a.user_id,a.tw_id) in (select user_id,tw_id from vitae group by user_id,tw_id having count(*) > 1)
and rowid not in (select min(rowid) from vitae group by user_id,tw_id having count(*)>1)
如果只是查出是去重:
select distinct user_id,tw_id from table
⑵ mysql怎么去除重复数据
//去除来重复源的数据 如果是重复的只显示1个
select distinct d_name from tbl_vod
--下面是查出重复的记录
select d_name from tbl_vod
minus
select distinct d_name from tbl_vod