//查询单个帖子的回帖数
select count(*) from 回帖表,发帖表 where 回帖表.贴子id=发帖表.帖子id
//查询所有帖子的回帖数
select 发帖表.帖子id,count(*) as 回帖数 from 回帖表,发帖表 where 回帖表.贴子id=发帖表.帖子id
group by 发帖表.帖子id
追问我要所有的回帖数目,不是单独查询
追答//查询每个帖子的回帖数
select 发帖表.帖子id,count(*) as 回帖数 from 回帖表,发帖表 where 回帖表.贴子id=发帖表.帖子id
group by 发帖表.帖子id