select * from xi a where (a.username) in (select username from xi group by username having count(*) > 1)
在 SQL 中增加 HAVING 子句原因是,WHERE 关键字无法与合计函数一起使用。