MySQL 过滤重复数据distinct 统计重复数据 group by having

MySQL 过滤重复数据distinct 统计重复数据 group by having

#过滤重复数据
select distinct user_code, user_name from app_users
#统计重复数据
select count(user_code) as  user_count, user_code from app_users group by user_code having user_code > 1

 

发表回复

您的电子邮箱地址不会被公开。