MySQL过滤器问题 [英] Mysql filter problem

查看:78
本文介绍了MySQL过滤器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我说我有一个公司有4个用户的数据库,每个用户有4个收件人,可以说用户4有以下收件人Abe,Andrew,Allan和bart,然后用户在filtertextbox中键入a来填充以说他想返回所有包含a的名称,然后它将返回Abe,Andrew并解决我遇到的问题是我的select语句将如下所示
从t个收件人中选择*,其中CompanyName = @CompanyName这是一个会话变量";和UserName = @UserName"这是一个会话变量"收件人,例如@ filtertext现在是安倍,安德鲁,艾伦"所以有一个问题,我只是不知道如何解决

lets say I have a database with a company 4 users and each user has 4 recipients lets say user 4 has the following recipients Abe, Andrew, Allan and bart the user then types in an a in the filtertextbox to fillter on lets say he wants to return all the names containing an a then it will return Abe,Andrew and allen the problem Im expreriencing is my select statement will then look like this
select * from t recipients where CompanyName = @CompanyName"this is an session variable" and UserName = @UserName"this is an session variable" and recipient like @ filtertext "which is now Abe, Andrew, Allan" so there is the problem I just dont know how to fix it

推荐答案

将查询用作...收件人,例如%a%";
use the query as ...recipient like "%a%";


这篇关于MySQL过滤器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆