select
* from
(select * from tmp group by userName having count(userName)= 1
union select * from tmp where id in ( select id from tmp group by userName having count(userName)> 1)
) aaa order by id
* from
(select * from tmp group by userName having count(userName)= 1
union select * from tmp where id in ( select id from tmp group by userName having count(userName)> 1)
) aaa order by id

被折叠的 条评论
为什么被折叠?



