聶十八 发表于 2010 年 11 月 22 日 10:02:03

哦用了count(*)
没用group by

haney 发表于 2010 年 11 月 22 日 10:22:18

文盲飘过

ftw 发表于 2010 年 11 月 22 日 10:47:47

这个很难清出来吧?

三叶草 发表于 2010 年 11 月 22 日 11:00:04

试试我QQ群里发的,

金光 发表于 2010 年 11 月 22 日 11:46:58

select author, count(*) from pre_forum_post_2 as b where b.fid='105' and b.tid='863265' and first=0 and mod(( select count(*) as dd from pre_forum_post_2 as a where a.fid='105' and a.tid='863265' and a.pid<b.pid order by pid) ,25)=0 group by author

select ( select count(*) as dd from pre_forum_post_2 as a wherea.fid='105' and a.tid='863265' and a.pid<b.pid order by pid) as xuhao, authorfrom pre_forum_post_2 as b where b.fid='105' and b.tid='863265' and first=0 and mod(( select count(*) as dd from pre_forum_post_2 as a wherea.fid='105' and a.tid='863265' and a.pid<b.pid order by pid) ,25)=0
这个是显示发帖的楼层数
页: 1 [2]
查看完整版本: 有懂SQL语句的帮金光整个法子