用ASP如何实现一种变量筛选

来源:百度知道 编辑:UC知道 时间:2024/05/11 17:17:33
想实现一种效果。即多个搜索结果里面筛选符合条件的。
举个例子。我输入8个甚至更多字 “五 包 万 像 十 罗 色 光”,自动在我数据库里面查找匹配的成语:五光十色、包罗万像。我的思路是查找不同的单字去匹配。匹配重复的就算成功。8个字就8个搜索结果。我现在就剩不知道怎么把8个搜索变量交错去比较。
还望高人费神指点。

如果有个成语库,就用SQL试试

select cy as 成语 from tb
where
(case when cy like '%五%' then 1 else 0 end )+
(case when cy like '%光%' then 1 else 0 end )+
(case when cy like '%十%' then 1 else 0 end )+
(case when cy like '%色%' then 1 else 0 end )+
(case when cy like '%包%' then 1 else 0 end )+
(case when cy like '%罗%' then 1 else 0 end )+
(case when cy like '%万%' then 1 else 0 end )+
(case when cy like '%象%' then 1 else 0 end ) >= len(cy)

太高了吧,,,

是sql的还是已在变量中的,楼上的回答还好啦,sql 对 mdb的试试找下正则,

关注。