You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
表test20181109
----------------
id - name
2 | c
1 | a
2 | b
1 | a
2 | b
----------------
查询重复数据:
select id from test20181109 group by id having`count(1)`>1
id
12
删除重复数据,并保留其中一条
deletefrom test20181109 where id in (
select id from test20181109 group by id havingcount(1)>1
) and rowid not in (
selectmin(rowid) test20181109 group by id havingcount(1)>1
)
处理后的数据:
----------------
id - name
2 | c
1 | a
----------------
The text was updated successfully, but these errors were encountered:
Repository owner
locked as resolved and limited conversation to collaborators
Nov 9, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
参考链接
针对没有主键的重复数据
查询重复数据:
删除重复数据,并保留其中一条
处理后的数据:
The text was updated successfully, but these errors were encountered: