拆分字符进行sql查询

发表于:2007-06-30来源:作者:点击数: 标签:
names=Split(session("city"),"|")
i=0

条件中带又带多个or 查询语句

sql="select * from qizu where 字段 like @#%"&session("字段")&"%@# and recycle=1 and("
for each name in names
sql=sql+"City like @#%"&names(i)&"%@# or "
i=i+1
next
sql=left(sql,len(sql)-4) &") order by id desc"


原文转自:http://www.ltesting.net