注册 登录
编程论坛 ASP技术论坛

关于ASP多表查询问题

fjhtf 发布于 2013-07-11 16:22, 658 次点击
orderok.asp?id=20130710008地址查询两表中的内容表1 orderid   orderid   title  stores表2 table相同字段 is name stores 请问查询表1 orderid为20130710008的值,并且stores字段来查询表2关联的数据    SQL语句要怎么写?谢谢!
1 回复
#2
ysf01812013-07-17 16:11
https://bbs.bccn.net/thread-217539-1-1.html 你看下,有介绍。看不懂,同志需要努力了。

除了上面还可以这样,

<%
set rs1 = server.createobject("adodb.recordset")
set rs2 = server.createobject("adodb.recordset")

rs1.open"select * from biao1 order by id desc",conn,1,1
do while not rs1.eof
   rs2.open"select * from biao2 where 字段 = "&rs1("字段")&"",conn,1,1
   '你想做的事情
   rs2.close
rs1.movenext
loop
rs1.close

%>
1