mysql删除重复行的实现方法
表relation
createtablerelation( idintprimarykeyauto_increment, userIdintnotnull, fanIdintnotnull );
插入几条数据
insertintorelation(userId,fanId) values(1,1),(1,1),(1,1),(2,2),(2,2),(3,3),(3,3);
表中的数据
id
userId
fanId
1
1
1
2
1
1
3
1
1
4
2
2
5
2
2
6
3
3
7
3
3
去重
deletetfromrelations joinrelationtusing(userId,fanId) wheres.id总结
以上所述是小编给大家介绍的mysql删除重复行的实现方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!
热门推荐
10 祝孙辈生日祝福语简短
11 恋人跨年祝福语大全简短
12 考大学敬酒简短祝福语
13 开工投产大吉祝福语 简短
14 偶然结婚祝福语朋友简短
15 感谢学长学姐祝福语简短
16 戏精的祝福语简短
17 我要结婚祝福语简短
18 婚前女儿生日祝福语简短