业务需求:电话号码相同的,根据时间取最新一条数据
select * from b_guest_info a where create_at = (select max(create_at) from b_guest_info b where a.mobile = b.mobile) order by create_at desc
MySQL – 先排序后分组
原文:https://www.cnblogs.com/nginxTest/p/14889061.html