#查找联系人中的uid是否有重复
SELECT * FROM contacts WHERE uid IN ( SELECT uid FROM contacts GROUP BY uid HAVING count(uid) > 1 )
#删除重复值
delete from contacts where id in (select id from (select id from contacts where uid in
(select uid from contacts group by uid having count(uid)>1) and id not in
(select min(id) from contacts group by uid having count(uid)>1)) as tmpresult)