有懂SQL语句的帮金光整个法子
哈哈.你们踢了那么久累不累啊?会MYSQL语句的帮金光写个语句.然后好让他一次性查询出来
select ( select count(*) as dd from pre_forum_post as a wherea.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) as xuhao, author, subject, messagefrom pre_forum_post as b where b.fid='863265' and b.tid='105' and first=0 and mod(( select count(*) as dd from pre_forum_post as a wherea.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) ,25)=0 不懂······· select ( select count(*) as dd from pre_forum_post as a wherea.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) as xuhao, author, count(*)from pre_forum_post as b where b.fid='863265' and b.tid='105' and first=0 and mod(( select count(*) as dd from pre_forum_post as a wherea.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) ,25)=0
这个只看发帖者.并显示踢中次数
哈哈.MYSQL不会.真累
还是MSSQL比较容易懂 本帖最后由 vica 于 2010-11-22 08:23 编辑
貌似只能按回复的pid排序,没有楼层数的字段。 高手········ vica 发表于 2010-11-22 08:22 static/image/common/back.gif
貌似只能按回复的pid排序,没有楼层数的字段。
哈哈。我就是按PID排序后再确定楼层的 高手,mysql和mssql大体上是一致的,可能函数名不一样,或者mysql不支持太复杂的子查询 mssql的话可以用
select distinct identity(int,1,1) ............ into
来生成楼层数 聶十八 发表于 2010-11-22 00:55 static/image/common/back.gif
select ( select count(*) as dd from pre_forum_post as a wherea.fid='863265' and a.tid='105' and a. ...
MySQL 返回:
#1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
聶十八 发表于 2010-11-22 00:51 static/image/common/back.gif
哈哈.你们踢了那么久累不累啊?
会MYSQL语句的帮金光写个语句.然后好让他一次性查询出来
select ( select count(*) as dd from pre_forum_post as a wherea.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) as xuhao, author, subject, messagefrom pre_forum_post as b where b.fid='863265' and b.tid='105' and first=0 and mod(( select count(*) as dd from pre_forum_post as a wherea.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) ,25)=0
页:
[1]
2