【急】select from 表名 where 字段=(从另一个表中读取的数值)
asp吧
全部回复
仅看楼主
level 8
xuhaohaooo 楼主
asp中从A表中读取到一个字段 怎么去吧B表中这个字段所对一个一个字段信息读取出来
现在只能把bigid那个83读取出来 怎么让他显示的是bigname
2014年10月27日 02点10分 1
level 11
set rs = Server.CreateObject("Adodb.RecordSet")
sql = "select * from [pro] where id=400"
rs.open sql,conn,1,1
if not rs.eof
set rs2 = Server.CreateObject("Adodb.RecordSet")
sql2 = "select * from [pjfld] where bigid="&rs("bigid")
rs2.open sql2,conn,1,1
end if
response.write rs2("bigname")
简化的话:
set rs = Server.CreateObject("Adodb.RecordSet")
sql = "select * from [pro],[pjfld] where pro.bigid=pjfld.bigid and id=400"
rs.open sql,conn,1,1
response.write rs("bigname")
2014年10月27日 04点10分 2
谢谢你 ,总算解决了
2014年10月27日 05点10分
回复 xuhaojihong :客气了
2014年11月17日 15点11分
level 12
good job
2014年11月18日 01点11分 3
level 6
建议你试试access的查询设计功能
2014年11月30日 02点11分 4
level 7
select pjflb.bigname from pro,pjflb where pro.bigid=pjflb.bigid and pro.bigid=83
2014年12月02日 02点12分 5
1