mysql 获取分组后 最早/最后的 第一条数据


【问题】 获取用户最后一次记录的 坐标记录

表记录截图:

 

【解决】

select max.*, MAX(max.createTime) createMax
From (select `autoID`, `openID`, `longitude`, `latitude`, `street`, `createtime` from t_userlocation_log order by createTime desc limit 100 ) max
group by openId

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM