获取某个人在同一个SourceID 下PostTime最大的记录:
自己的代码:
select A.* from psmc_user_assembly A,(
自己的代码:
select A.* from psmc_user_assembly A,(
SELECT SourceID,max(PostTime) maxpost FROM `psmc_user_assembly` where UserID='7f261265-7606-4800-92a8-b70413ecf0cc' GROUP BY SourceID ORDER BY PostTime )B where A.SourceID=B.SourceID and A.PostTime=b.maxpost;
参考:
http://www.2cto.com/database/201211/169178.html
http://blog.csdn.net/tatagg/article/details/43672487?locationNum=5
http://www.cnblogs.com/myjoan/p/6123304.html
http://www.tuicool.com/articles/j6vQzaI
http://blog.csdn.net/looksun/article/details/41172293
感谢上述几篇文章的作者的分享。