delete from userinfo t
where t.uname in (select t.uname from userinfo t group by t.uname having count(*) > 1)
and rowid not in (select min(rowid) from userinfo t group by t.uname having count(*) >1)
delete from userinfo t
where t.uname in (select t.uname from userinfo t group by t.uname having count(*) > 1)
and rowid not in (select min(rowid) from userinfo t group by t.uname having count(*) >1)