SQL语句:那样写还不如这样写

 

那样写:

set rs=conn.execute("select * from Books")
while not rs.eof
rs2=conn.execute("select * from Authrs where AuthorID="&rs("AuthorID"))
Response.write rs("Title")&">>"&rs2("Name")
rs.movenext()
wend

 

这样写:

strSQL="SELECT Books.Title,Authors.Name FROM Books JOIN Authors ON Authors.AuthorID=Books.AuthorID"
set rs=conn.execute(strSQL)
while not rs.eof
Response.write rs("Title")&">>"&rs("Name")
rs.movenext()
wend

posted @ 2008-10-24 14:19  missthe  阅读(173)  评论(0编辑  收藏  举报