找回密码
 注册
广告投放 虚位以待【阿里云】2核2G云新老同享 99元/年,续费同价做网站就用糖果主机-sugarhosts.comJtti.com-新加坡服务器,美国服务器,香港服务器
查看: 641|回复: 14

有懂SQL语句的帮金光整个法子

  [复制链接]
发表于 2010 年 11 月 22 日 00:51:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
哈哈.你们踢了那么久累不累啊?
+ O0 w- F  R6 ]; R2 E# \2 ]# l& ?会MYSQL语句的帮金光写个语句.然后好让他一次性查询出来- T0 F* |$ G! e( X$ G9 _0 Q

. Q+ E# d& w, N' c& p4 s9 ~( O( ^$ M9 Z  a2 R

& l3 l9 f0 \/ |& b& u  A6 Cselect ( select count(*) as dd from pre_forum_post as a where  a.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) as xuhao, author, subject, message  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 where  a.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) ,25)=0
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
发表于 2010 年 11 月 22 日 00:52:13 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
不懂·······
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2010 年 11 月 22 日 00:55:40 | 显示全部楼层
select ( select count(*) as dd from pre_forum_post as a where  a.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 where  a.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) ,25)=0
5 r. W" M1 o* \6 W+ _( b
" N1 L4 q5 L: A( \2 h  G$ ?: D% r
4 {7 L3 f" g: C- x2 m这个只看发帖者.并显示踢中次数
7 m8 x+ @( Z6 V哈哈.MYSQL不会.真累
  R3 V8 ~, ^4 z! d3 ^2 d还是MSSQL比较容易懂
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2010 年 11 月 22 日 08:22:52 | 显示全部楼层
本帖最后由 vica 于 2010-11-22 08:23 编辑
, Y$ f4 ?( d: w! A; _( N. B& _- j# S8 W2 d0 f4 ]9 W3 n' V* h% I
貌似只能按回复的pid排序,没有楼层数的字段。
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2010 年 11 月 22 日 08:31:40 | 显示全部楼层
高手········
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2010 年 11 月 22 日 09:03:06 | 显示全部楼层

点评

不过可以看下显示楼层数的页面代码是什么,直接写个页面填帖子ID搜楼层也行。  发表于 2010 年 11 月 22 日 09:36
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2010 年 11 月 22 日 09:19:18 | 显示全部楼层
【腾讯云】2核2G云服务器新老同享 99元/年,续费同价
高手,mysql和mssql大体上是一致的,可能函数名不一样,或者mysql不支持太复杂的子查询
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

 楼主| 发表于 2010 年 11 月 22 日 09:40:07 | 显示全部楼层
mssql的话可以用- b" j! t  o0 X
select distinct identity(int,1,1) ............ into
) ]/ h8 y  U* n/ t' u 来生成楼层数
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2010 年 11 月 22 日 10:00:09 | 显示全部楼层
聶十八 发表于 2010-11-22 00:55 & `" q6 j. D1 v4 W( g1 c
select ( select count(*) as dd from pre_forum_post as a where  a.fid='863265' and a.tid='105' and a. ...
- a8 o/ C, q' P! E. z
MySQL 返回: 7 t+ d! X/ s# @7 Z" u  \* p

* n1 j8 Z4 D* m6 N( X#1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
1 k" h) a( r9 s0 R; }# m5 d- Z
4 E, l, j" e# n# ]# Q
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

发表于 2010 年 11 月 22 日 10:00:27 | 显示全部楼层
聶十八 发表于 2010-11-22 00:51 $ r% p- U* a2 c; B
哈哈.你们踢了那么久累不累啊?
9 ]; k' y1 D# v( J  \  V会MYSQL语句的帮金光写个语句.然后好让他一次性查询出来
3 ~6 y1 F4 w7 w. z- ?! ?9 T
select ( select count(*) as dd from pre_forum_post as a where  a.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) as xuhao, author, subject, message  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 where  a.fid='863265' and a.tid='105' and a.pid<b.pid order by pid) ,25)=0
Jgwy.Com - Free Web Hosting Guide & Directory In China since 2001! Jgwy.Net-Jglt.Net
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|金光论坛

GMT+8, 2025 年 5 月 24 日 15:44 , Processed in 0.046840 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表