这个查询语句怎么写?
有一个案例的详细介绍页面,caseshow.asp 案例分类大分类名为:bigclassname 二级分类名为:smallclassname 详细内容页的其它字段是 title 我在大分类下建立了“雪铁龙案例” 然后直接在大分类下添加了这个案例的内容,案例的标题也是 "雪铁龙案例一", 然后在大分类 "雪铁龙案例" 在建立一个二级分类“雪铁龙案例一”,再在这个二级分类下添加了五篇细分的介绍。 我现在需要在案例的最终展示页面上 同事调用 五篇二级分类的文章标题,请问怎么操作?查询语名如何写?下面是案例展示页的代码:
<!--#include file="Inc/SysProduct.asp" -->
<%
MaxPerPage=MaxPerPage_Default
strFileName="business.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName
%>
<%
ShowSmallClassType=ShowSmallClassType_Article
dim ID
ID=trim(request("ID"))
if ID="" then
response.Redirect("business.asp")
end if
sql="select * from Product where ID=" & ID & ""
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if rs.bof and rs.eof then
response.write"<SCRIPT language=JavaScript>alert('找不到此案例!');"
response.write"javascript:history.go(-1)</SCRIPT>"
else
rs("Hits")=rs("Hits")+1
rs.update
%>
<%
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function%>
<%
title=request("title")
%>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" background="16/40.jpg">
<tr>
<td height="249" colspan="2" valign="top" style="line-height:25px; padding-top:1px;"><table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" colspan="2"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" valign="top"><%=rs("Content")%></td>
</tr>
</table></td>
</tr>
<tr>
<td
height="1" colspan="2" bgcolor="#CCCCCC"></td>
</tr>
</table></td>
<td width="10" valign="top"><br /></td>
<td width="1" valign="top" bgcolor="#333333"></td>
<td width="3" valign="top"></td>
<td width="186" valign="top" bgcolor="0F1C2F"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="44"><table width="160" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="160" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td><img class="picbox" border="1" src="<%=rs("DefaultPicUrl")%>" width="160" height="100" /></td>
</tr>
</table></td>
</tr>
</table>
<table width="160" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="37"><div align="center"><font color="#FFFFFF" size="2"> <%=rs("title")%> </font></div></td>
</tr>
</table>
<table width="160" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="37">
<table border="0" cellspacing="0" cellpadding="0" align="left" style="margin-top:4px;">
<tbody>
<%
dim title
title=trim(request("title"))
set rs_news=server.createobject("adodb.recordset")
sqltext6="select top 10 * from product where smallclassname='"& title &"' order by id desc"
rs_news.open sqltext6,conn,1,1
%>
<%i=0
do while not rs_news.eof%>
<tr >
<td height="20" width="20" align="middle"><span style="color: #FF0000">.</span></td>
<td ><div align="left"><a href="caseShow.asp?id=<%=rs_news("id")%>" target="_blank" ><%=cutstr(rs_news("title"),34)%></a> </div></td>
</tr>
<%rs_news.movenext
i=i+1
if i=10 then exit do
loop
rs_news.close %>
</tbody>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
call CloseConn()
%>
新手只有20分,实在不好意思,谢谢!