如何一次在数据库中搜索5列 [英] How to search in 5 Columns at a time in database

查看:73
本文介绍了如何一次在数据库中搜索5列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

select A.*,B.equipment_group,C.type 
from equipment as A 
inner join equipment_group as B on B.id=A.egroup 
inner join equipment_type as C on C.tid=A.etype 
where C.type like '%$dropvalue%' 
or A.ename like '%$dropvalue%' 
or B.equipment_group like '%$dropvalue%'


这是我要在数据库中搜索的查询,我正在从文本框中获取dropvalue.这意味着无论您在文本框中输入的内容是什么,它都会根据该值在数据库中进行搜索..

它正在工作,但是如果有更多记录,那么寻找任何时间都可以帮忙.


this is my query to search in database i am taking dropvalue from a textbox. that mean what ever you enter in text box it will search in database by that value..

It is working But if more records are there it is taking time to search can any one help.

推荐答案

dropvalue%' A.ename like '
dropvalue%' or A.ename like '%


dropvalue%' B.equipment_group 喜欢 '
dropvalue%' or B.equipment_group like '%


dropvalue%'
dropvalue%'


这是我要在数据库中搜索的查询,我正在从文本框中获取dropvalue.这意味着无论您在文本框中输入的内容是什么,它都会根据该值在数据库中进行搜索..

它正在工作,但是如果有更多记录,这将需要一段时间才能进行搜索.


this is my query to search in database i am taking dropvalue from a textbox. that mean what ever you enter in text box it will search in database by that value..

It is working But if more records are there it is taking time to search can any one help.


这篇关于如何一次在数据库中搜索5列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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