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
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/archive/2013/05/29/3105587.html