在论坛中获得回复总数 [英] getting reply totals in forum
问题描述
嗨其他人
我必须先,再次感谢Mary在过去几天的帮助。
我有以下sql给我所有的信息我想要到目前为止,但是在添加每个线程的回复数量方面已经遇到了问题。
在此语句中,posttype引用的是一个colum,其中新线程为1,回复为2。
我需要的是重写语句以返回我到目前为止的所有内容以及当posttype 2'的topicID等于相关posttype 1的topicID时的回复计数
因为我们的任何帮助都会非常感激,我的现有声明如下:
试试这个...
展开 | 选择 | 换行 | 行号
试试这个...
展开 | / span> 选择 | 换行 | 行号
嗨玛丽
再次感谢您的帮助和提示回复
如果我运行那个我得到以下错误(我看到了(在第二个SELECT语句前面 - 我已经尝试删除它并没有区别)
错误是
执行错误数据库查询。
[Macromedia] [SequeLink JDBC驱动程序] [ODBC套接字] [Microsoft] [ODBC Microsoft Access驱动程序] FROM子句中的语法错误。
错误发生在C:\ CFusionMX \ www.root \Forum \ topic.fm:第37行
35:FROM线程GROUP BY topicID)作为T2
36:ON threads.topicID = T2.topicID
37:WHERE threads.catID =#url.catID#
38:AND posttype = 1)
39:ORDER BY ThreadID DESC
之后不应该有一个结束括号posttype = 1
Hi Peoples
I must first, again thank Mary for her help over the last couple of days.
I have the following sql that get me all the info i want so far, but have hit a wall when it comes to adding the number of replies per thread.
In this statement the posttype refered to is a colum that holds 1 for new threads and 2 for replies.
What i need is to rewrite the statement to return me everything i have so far plus a count of replies when the topicID of posttype 2''s equals the topicID of the related posttype 1
As ususal any help in this would be very much appreciated and my existing statement follows
Expand|Select|Wrap|Line Numbers解决方案Try this ...
Expand|Select|Wrap|Line Numbers
Try this ...
Expand|Select|Wrap|Line Numbers
Hi Mary
Again thanks for the help and the prompt reply
If i run that i get the following error (i see a ( in front of the 2nd SELECT statement - i have tried removing it and no difference)
error is
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
The error occurred in C:\CFusionMX\wwwroot\Forum\topics.cfm: line 37
35 : FROM threads GROUP BY topicID) As T2
36 : ON threads.topicID = T2.topicID
37 : WHERE threads.catID=#url.catID#
38 : AND posttype=1)
39 : ORDER BY ThreadID DESCThere shouldn''t be a closing bracket after posttype=1
这篇关于在论坛中获得回复总数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆