欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mysql去重,不用distinct和group by

程序员文章站 2022-05-17 22:40:12
...
select * from t_risk_log t where claim_no='0000626040'

mysql去重,不用distinct和group by

 

根据claim_no和response_time去重,sql如下

select * from t_risk_log t ,(select claim_no,max(response_time) response_time from t_risk_log where claim_no='0000626040' group by claim_no ) m 
where t.response_time=m.response_time and t.claim_no=m.claim_no

mysql去重,不用distinct和group by

相关标签: oracle/mysql