
asp 数组 急哦~~在线等着,答案正确的送50分。
bj=session("bj")aryReturn=Split(bj,",")Fori=LBound(aryReturn)ToUBound(aryReturn)bj=Ri...
bj=session("bj")
aryReturn= Split(bj,",")
For i = LBound(aryReturn) To UBound(aryReturn)
bj=Right(aryReturn(i),Len(aryReturn(i)))
strSQL="Select * From student where s_c_id="&session("ys")&" and b_id="&bj&" Order By s_id Desc"
Next
rs.open strSQL,conn,1,1
session("bj")是一个数组,1,2,3这种格式的,通过for循环bj能分别得到这三个数,我要把这个作为一个条件查询,上面的代码只能得到三条strSQL不同的语句,但是rs.open strSQL,conn,1,1 查询的时候就只根据其中一条来查询了。有没有办法只让b_id="&bj&"这个条件来循环呢~
呵呵~是的是的
你知道怎么做吗?要是能帮我解决100分也送
呵呵~谢谢啊~原来这样就不需要用for循环了~解决了
能再问一下吗?in是什么意思啊,作用这么大呀 展开
aryReturn= Split(bj,",")
For i = LBound(aryReturn) To UBound(aryReturn)
bj=Right(aryReturn(i),Len(aryReturn(i)))
strSQL="Select * From student where s_c_id="&session("ys")&" and b_id="&bj&" Order By s_id Desc"
Next
rs.open strSQL,conn,1,1
session("bj")是一个数组,1,2,3这种格式的,通过for循环bj能分别得到这三个数,我要把这个作为一个条件查询,上面的代码只能得到三条strSQL不同的语句,但是rs.open strSQL,conn,1,1 查询的时候就只根据其中一条来查询了。有没有办法只让b_id="&bj&"这个条件来循环呢~
呵呵~是的是的
你知道怎么做吗?要是能帮我解决100分也送
呵呵~谢谢啊~原来这样就不需要用for循环了~解决了
能再问一下吗?in是什么意思啊,作用这么大呀 展开
2个回答
展开全部
in 在sql中就相当于多个 or
strSQL="Select * From student where s_c_id="&session("ys")&" and b_id in (1,2,3) Order By s_id Desc"
相当于
strSQL="Select * From student where s_c_id="&session("ys")&" and b_id = 1 or b_id = 2 or b_id = 3 Order By s_id Desc"
恭喜恭喜
楼主插红旗吧。。。
呵呵
strSQL="Select * From student where s_c_id="&session("ys")&" and b_id in (1,2,3) Order By s_id Desc"
相当于
strSQL="Select * From student where s_c_id="&session("ys")&" and b_id = 1 or b_id = 2 or b_id = 3 Order By s_id Desc"
恭喜恭喜
楼主插红旗吧。。。
呵呵
2007-06-23
展开全部
you like 英语
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询