源地址:http://zhidao.baidu.com/link?url=ZgCztNzCScRI5kAqGqug1LJvf7IX311EQs6fJ0-W1kOtWaaR7MrtLoV_228Ed8Fhbk6EZQeOSfZzCDQNcBUvtq
select a, count(1) from tab group by a
就可以找出a有几条记录
如果要找出多于一条的重复记录
select a, count(1) from tab group by a having count(1) >1
源地址:http://zhidao.baidu.com/link?url=ZgCztNzCScRI5kAqGqug1LJvf7IX311EQs6fJ0-W1kOtWaaR7MrtLoV_228Ed8Fhbk6EZQeOSfZzCDQNcBUvtq
select a, count(1) from tab group by a
就可以找出a有几条记录
如果要找出多于一条的重复记录
select a, count(1) from tab group by a having count(1) >1