Split 程序代码
复制代码 代码如下: lt;%attribs="商场名^^快餐店名^^报停名" names=Split(attribs,"^^") i=0 for each name in names nbsp; response.write names(i)"lt;brgt;" nbsp; i=i+1 next %gt;
程序拆分结果: 商场名 快餐店名 报停名
根据 Split 结果生成 SQL 语句
复制代码 代码如下: lt;%attribs="商场名^^快餐店名^^报停名" names=Split(attribs,"^^") i=0 sql="select top 10 * from TableName where" for each name in names nbsp; if names(i)="商场名" then nbsp;nbsp;nbsp; sql=sql+" or 商场 like '%"names(i)"%'" nbsp; end if nbsp; if names(i)="快餐店名" then nbsp;nbsp;nbsp; sql=sql+" or 快餐店 like '%"names(i)"%'" nbsp; end if nbsp; if names(i)="报停名" then nbsp;nbsp;nbsp; sql=sql+" or 快餐店 like '%"names(i)"%'" nbsp; end if nbsp; i=i+1 next sql=sql+" Ordey by Id DESC" sql=Replace(sql, "where or", "where") response.write sql %gt;
程序运行结果: 复制代码 代码如下: select top 10 * from TableName where 商场 like '%商场名%' or 快餐店 like '%快餐店名%' or 快餐店 like '%报停名%' Ordey by Id DESC
(编辑:淮北站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|