场景:
如有这样一张表,存在字段BSM(标识码),按照某项规定(GB 国标),此字段必须唯一,现在简单的来检索是否存在重复数据。
基本格式:
select 列名, count(*) as CFCS from 表名 group by 列名 having count(列名)>1
实测:
select BSM, count(*) as CFCS from CBDKXX group by BSM having count(BSM)>1
场景:
如有这样一张表,存在字段BSM(标识码),按照某项规定(GB 国标),此字段必须唯一,现在简单的来检索是否存在重复数据。
基本格式:
select 列名, count(*) as CFCS from 表名 group by 列名 having count(列名)>1
实测:
select BSM, count(*) as CFCS from CBDKXX group by BSM having count(BSM)>1