SQL查询问题 在线等
时间:2011-07-13
来源:互联网
num=5
piclistid="1,2,3,4,5" '这里的1,2,3,4,5为动态多个分类ID
function piclist(num,piclistid)
gettest="where ..............." '多个动态分类ID,怎么来截取分类ID个数,然后这里的筛选要怎么写
set rs=server.createobject("adodb.recordset")
rs.open"select * from picview "&gettest&" order by newid() desc",conn,1,1
If not rs.eof Then
Response.write(picurl)
end if
rs.close
set rs=nothing
end function
piclistid="1,2,3,4,5" '这里的1,2,3,4,5为动态多个分类ID
function piclist(num,piclistid)
gettest="where ..............." '多个动态分类ID,怎么来截取分类ID个数,然后这里的筛选要怎么写
set rs=server.createobject("adodb.recordset")
rs.open"select * from picview "&gettest&" order by newid() desc",conn,1,1
If not rs.eof Then
Response.write(picurl)
end if
rs.close
set rs=nothing
end function
作者: BENCQS 发布时间: 2011-07-13
木有明白!
作者: chen_bruce 发布时间: 2011-07-13
gettest="where id in ("&piclistid&")"
作者: aspwebchh 发布时间: 2011-07-13
表,字段,查询要求
作者: gingerkang 发布时间: 2011-07-13
function piclist(num,piclistid)
piclistid=split(piclistid,",")
sql="select * from picview where"
for i=0 to ubound(piclistid)
sql=sql+"id="+""&piclistid(i)&""
if ubound(piclistid)>i+1 then
sql=sql+"or"
end if
next
sql=sql+"order by newid() desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
If not rs.eof Then
Response.write(picurl)
end if
rs.close
set rs=nothing
end function
piclistid=split(piclistid,",")
sql="select * from picview where"
for i=0 to ubound(piclistid)
sql=sql+"id="+""&piclistid(i)&""
if ubound(piclistid)>i+1 then
sql=sql+"or"
end if
next
sql=sql+"order by newid() desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
If not rs.eof Then
Response.write(picurl)
end if
rs.close
set rs=nothing
end function
作者: ma1986 发布时间: 2011-07-13
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28