求助临时表怎么链接查询呀

常规的多条件查询可以写成这样
<%
set rs= server.CreateObject("adodb.recordset")
if fl1=0 then sql ="select * from tuku where img<>''"
if fl2<>0 and fl2<>"" then sql=sql&" and kj="&fl2
if fl3<>0 and fl3<>"" then sql=sql&" and fg="&fl3
if fl4<>0 and fl4<>"" then sql=sql&" and zj="&fl4
if fl5<>0 and fl5<>"" then sql=sql&" and ys="&fl5
if fl6<>0 and fl6<>"" then sql=sql&" and hx="&fl6
rs.open sql,conn,1,1
if rs.eof then%>

求助下面的临时表查询怎么能实现上面这样的查询方式

<%if l1=0 and l2=0 then
sql2="select xx.* from picture as xx,(select tid,min([px]) as zz from picture group by tid) as yy where xx.tid=yy.tid and xx.px=yy.zz"
elseif l2>0 and l3=0 then
sql2="select xx.* from picture as xx,(select tid,min([px]) as zz from picture where lb="&l2&" group by tid) as yy where xx.tid=yy.tid and xx.px=yy.zz and xx.lb="&l2&""
elseif l3>0 and l4=0 then
%>

照这样写下去太乱了,看的眼都花了,我的条件有很多。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值