数据库有个表 含有字段tid (帖子id) author (发帖或者回帖作者) first(含有数字1和0 1代表这个帖子是作者发的帖子,0代表这个帖子是回的帖子) subject(是主题 如果first=1 主题即为发帖的题名,如果first=0 主题为空) 我想要获取这个表中,帖子回复最多的帖子名称,回帖数量,以及作者名称,
我是这样做的,select count(tid) as number, tid,author,subject from cdb_posts where first=0 group by tid order by count(tid) desc limit 0,1这样只能得到帖子tid 和作者名称 subject为空 因为我限制了first=0,我该怎么改进这个sql语句才能做到 可以吧count(tid),author,subject都查询出来呢。在线等高人。