载入数据...
http://hb01846.99365.net/
时间记忆
载入数据...
最新评论
载入数据...
我的公告
载入数据...
我的相册
最新留言
载入数据...
我的好友
载入数据...
用户登陆
载入数据...
友情链接
博客信息
载入数据...



日志
根据 Split 结果生成 SQL 语句 | 2008-11-15 9:56:00

<%attribs="商场名^^快餐店名^^报停名"
names=Split(attribs,"^^")
i=0
sql="select top 10 * from TableName where"
for each name in names
  if names(i)="商场名" then
    sql=sql+" or 商场 like '%"&names(i)&"%'"
  end if
  if names(i)="快餐店名" then
    sql=sql+" or 快餐店 like '%"&names(i)&"%'"
  end if
  if names(i)="报停名" then
    sql=sql+" or 快餐店 like '%"&names(i)&"%'"
  end if
  i=i+1
next
sql=sql+" Ordey by Id DESC"
sql=Replace(sql, "where or", "where")

response.write sql%>

程序运行结果:
select top 10 * from TableName where 商场 like '%商场名%' or 快餐店 like '%快餐店名%' or 快餐店 like '%报停名%' Ordey by Id DESC
阅读全文 | 回复(0) | 引用通告 | 编辑 | By: Jack
  • 标签:advantage ASP 
  • 发表评论:
    载入数据...
    Design by Copyright sohai.net 2006-2008 reserved
    Powered by Oblog.