create temporary table tmp_wrap select * from test group by uid having count(1) > 1 union all select * from test group by uid having count(1) = 1;
我主要是不明白 count(1)=1和count(1) > 1各自是什么意思,为什么查询结果合并到一起就是不重复的呢?