- 查询重复数据(根据多个字段)
select * from sms_trace_low_history a
where (a.mobile,a.sms_content) in (select mobile,sms_content from sms_trace_low_history group by mobile,sms_content having
count(*) > 1) order by a.mobile
通过字符串连接符连接多个字段,并进行分组,从而可以查询出相同的内容,以及相同内容的条数
select mobile||sms_content,count(*) from sms_trace_low_history group by mobile||sms_content having count(*)>1