sql 删除重复

删除表中多余的重复记录,重复记录是根据单个字段(id)来判断,只留有rowid最小的记录 
 
 //删除用户 根据用户名,并且不包括最小ID
delete from users where username in (
         --根据用户名称排序,大于1
select username from users group by username having count(username) > 1

More...