贾政就是个伪君子:asp与sql问题

来源:百度文库 编辑:高考问答 时间:2024/05/06 00:38:24
在asp中,我想将两个表合并因该怎么做啊?
例:table1 name riqi table2 name didian
生成 table3 name riqi didian 应该怎么做啊
希望高手帮帮忙啊,在asp中怎么实现?
我要在数据库中建个新的表格,把得到的数据存到数据库,应该怎么办

str="select a.name,a.riqi,b.didian from table1 a inner join table2 b on where a.id=b.id"
rs.open str,conn,1,3,1
rs2.open "table3",conn,1,2,2
for i=1 to rs.recordcount
if not rs.bof and not rs.eof then
rs2.addnew
rs2("name")=rs("name")
rs2("riqi")=rs("riqi")
rs2("didian")=rs("didian")
rs2.update
rs.movenext
else
exit for
end if
next

sql="select a.name,a.riqi,b.didian from table1 a inner join table2 b on where a.name=b.name"
rs.open sql,conn,1,1