62,265
社区成员
发帖
与我相关
我的任务
分享
select distinct t2.title, t1.mingzi, count(1) as number
from yonghu t1, liuyan t2, huifu t3
where t1.id = t3.userid
and t2.id = t3.lyid
and t1.id = '指定的ID'
group by t2.title, t1.mingzi
select 标题=title,
发布人=u.mingzi,
回复数=count(1),
最后更新=max(r.date)
from 留言表 l join 用户信息表 u on l.userid=u.id
join 回复表 r on l.id=r.lyid
join 用户信息表 u2 on r.userid=u2.id
where u2.userid=用户ID
group by title