增资金额大于注册资本:ASP--怎样排列显示ID前10到前20名的数据!
来源:百度文库 编辑:高考问答 时间:2024/05/21 22:18:53
select top 10 id,topic from news where id=1 order by id desc
以上语句为前10个,我想在另一个表中,显示前面第11个到前20个的数据!应怎样做!谢谢!
菜死了!
全文如下!
————————————————————————
<table border=0 cellspacing=0 cellpadding=0 width='100%'>
<%
sql="Select top 10 id,topic From news where hidden<11 order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
id=rs("id")
topic=rs("topic")
rs.move(10)
for i=1 to 10
response.write vbcrlf&" <tr><td height='"&dim_num(6)&"'> · <a href='news_view.asp?id="&id&"' target=_blank alt='"&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,16)&"</a></td></tr>"
rs.movenext
loop
rs.close
%>
</table>
——————————————————————
第二个表怎样改过来!现在二个表显示一样!我想第二个表接第一个表来显示!
以上语句为前10个,我想在另一个表中,显示前面第11个到前20个的数据!应怎样做!谢谢!
菜死了!
全文如下!
————————————————————————
<table border=0 cellspacing=0 cellpadding=0 width='100%'>
<%
sql="Select top 10 id,topic From news where hidden<11 order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
id=rs("id")
topic=rs("topic")
rs.move(10)
for i=1 to 10
response.write vbcrlf&" <tr><td height='"&dim_num(6)&"'> · <a href='news_view.asp?id="&id&"' target=_blank alt='"&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,16)&"</a></td></tr>"
rs.movenext
loop
rs.close
%>
</table>
——————————————————————
第二个表怎样改过来!现在二个表显示一样!我想第二个表接第一个表来显示!
rs.movefirst
rs.move(10)
for i=1 to 10
...
rs.movenext
...
next
''''''''''''''''''''''''''''''''''''
你说的第二个表是指本程序再次运行所产生的表吗?(因为程序片断中没有生成第二个表的代码)若是这样,必须把move(10)改为move(session("XXX")),否则再次运行指针又复原了。
'''''''''''''''''''''''''''''''''''''
不需要"select top 10 ..." 中的 "top 10"
一次查出top 30
再用程序处理让它分别在3个表中显示10条数据。。
SELECT TOP 10 FROM 表名 where 条件
保证好用
好用 给旗 呀 楼主 谢谢了
select top 10 id,topic from news where id>'10 'order by id
这样就可以了!
用分页功能
弄个分页每页显示10条,那么第二页不就是后面的10条了?