关于“查询语句过于复杂”
老师们:有如下代码:
================================
A=trim(request("AA"))
B=trim(request("BB"))
C=trim(request("CC"))
D=trim(request("DD"))
E=trim(request("EE"))
F=trim(request("FF"))
G=trim(request("GG"))
H=trim(request("HH"))
I=trim(request("II"))
J=trim(request("JJ"))
K=trim(request("KK"))
L=trim(request("LL"))
.....................
================================
我想查询“包含以上任意三个条件,且不包含除这三个条件以外的其他条件”
例如:查询“=A and =B and =C,但不等于D,E,F,G,H,I,J,K,L”
<%
Orderby=" Where (A = ('"& A &"') AND B = ('"& B &"') AND C = ('"& C &"')) OR (A = ('"& A &"') AND B = ('"& B &"') AND D = ('"& D &"')) OR (.............)"
Orderby=Orderby&" Order By XM Asc"
set Waitrs=WS_S.HX_SetRSD("XM,A,B,C,D,E,F,G,H,I,J","BIAO",Orderby)
%>
<%
do while not Waitrs.EOF
%>
<%=Waitrs("XM")%>
<%
Waitrs.movenext
loop
%>
<%
Waitrs.close:set Waitrs=nothing
%>
我把所有的组合都写出来了,但系统报错如下:查询语句过于复杂
请问老师,用什么方法可以更简单的实现?感谢!