实际现象:将select top 修改为3条以上 ,数据库中的消息就全部显示。
解决思路:两种: 1. 添加个无重复值的列排序辅助一下。 (如下修改方法)
2.在输出显示时判断数目,到了你想要的数目就终止输出。
原第5条 "Order By time_stamp DESC"
hit有重复值,增加一个排序列就可以了,hit有重复值也不应该显示6条。
修改后 "Order By time_stamp DESC,iid desc"
<% set rs=server.createobject("adodb.recordset")
Sql="select top 6 * From info where "&_
"iid In (Select iid From info_cat_map "&_
"where icid='2009222131214') "&_
"Order By time_stamp DESC,iid desc"
Set rs=Conn.Execute(Sql)
Do While Not rs.Eof
if rs("flag")=1 then
title_str="<font color=red>"&LimitWords(rs("title"),25)&"<img src=images/new.gif border=0 align=absbottom></img></font>"
else
title_str=LimitWords(rs("title"),25)
end if
%>
翻译中心 http://www.360edu.org.cn/interpret.asp 北京团体语言培训 企业外语培训