select * from login a
where rowid!=(select min(rowid) from login b where a.username=b.username)
delete from login a
where rowid!=(select max(rowid) from login b where a.username=b.username)
where rowid!=(select min(rowid) from login b where a.username=b.username)
delete from login a
where rowid!=(select max(rowid) from login b where a.username=b.username)