魔力宝贝1国语版:asp可以同时用and和or选择数据吗

来源:百度文库 编辑:中科新闻网 时间:2024/05/15 01:07:36
如例:
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from book where id=1 and cid like '%"&key%"%' or pid like '%"&key%"%'"
rs.open sql,conn,1,3
%>

谢谢!

<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from book where id=1 and (cid like '%"&key%"%' or pid like '%"&key%"%')"
rs.open sql,conn,1,3
%>

可以 它们并不冲突