蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程


    

蓝森林 http://www.lslnet.com 2006年8月25日 8:28

[asp]帮我看一个sql语句,会不会很慢?

[code]<% set rs2=server.createobject("adodb.recordset")
sql="select * from table1 where ( sf='江苏' and dq='南京') or ( sf='江苏' and dq='none') or type='all'"
rs2.open sql,conn,1,1
do while not rs2.eof
response.Write(rs2("id")&","&rs2("users")&"<br>")
rs2.movenext
loop
%>
[/code]

[img]http://n2n2.cn/up/2005114953796.gif[/img]

[code]
<% set rs2=server.createobject("adodb.recordset")
sql="select * from table1 where ( sf='江苏' and dq='南京') or ( sf='江苏' and dq='none') or type='all'"
rs2.open sql,conn,1,1
if not (rs.bof and rs.eof) then       '------检查记录集是否为空
do while not rs2.eof
response.Write(rs2("id")&","&rs2("users")&"<br>")
rs2.movenext
loop
else
response.write "没有数据"
end if
%>
[/code]




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com