SQL查询某一字段是否是唯一值或是否有重复值

select 重复记录字段 from  数据表 group by 重复记录字段 having count(重复记录字段)>1

select user_id from table_a where ds='20220320' group by user_id having count(user_id)>1;

select user_id,count(*) table_a where ds='20220319' group by user_id having count(user_id) >1

 

posted @ 2022-03-21 16:08  大熊童鞋  阅读(3281)  评论(0编辑  收藏  举报