SQL:找出我(uid=2)所有的好友信息,和这些好友发布的最新的一篇文章

select f.fid, u.nick_name, u.uname, u.icon ,t.content, t.add_time 
from friends f, user u , (select content, add_time,uid from topic order by add_time desc) t 
where f.uid = 2 
and f.fid = u.id 
and t.uid = f.fid 
group by f.fid 
order by f.add_time desc
原文地址:https://www.cnblogs.com/kingfly/p/3105587.html