![]() |
#2
wangzhi85152013-01-16 09:43
|

set rs=server.createobject("adodb.recordset")
sql="select * from book where"
if b_class<>"" then
sql=sql&" b_class like '%"&b_class&"%'"
flag=1
end if
if b_intro<>"" and flag=1 then
sql=sql&" and b_intro like '%"&b_intro&"%'"
flag=1
elseif b_intro<>"" then
sql=sql&" b_intro like '%"&b_intro&"%'"
flag=1
end if
我查询出来的结果排序貌似是乱的 该怎么调整呢?本人是新手还请大侠们消息指点下!谢谢! sql="select * from book where"
if b_class<>"" then
sql=sql&" b_class like '%"&b_class&"%'"
flag=1
end if
if b_intro<>"" and flag=1 then
sql=sql&" and b_intro like '%"&b_intro&"%'"
flag=1
elseif b_intro<>"" then
sql=sql&" b_intro like '%"&b_intro&"%'"
flag=1
end if