从多列中搜索记录 [英] search records from multiple columns

查看:72
本文介绍了从多列中搜索记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为此问题创建一个存储过程-我有一个包含类别和产品的表.如何从两列中搜索值.如果我使用类别名称,则所有产品均显示该类别.如果我选择产品名称,则不显示产品名称及其类别名称.
如果我输入"BABY CREAM",则首先在该"BABY"和"CREAM"之后显示有关"BABY CREAM"的结果.

Create a stored Procedure for this problem--i have a table that contain category and product. how to search value from both columns. If i take a category name then all product show from that category. If i select product name than show product name and its category name.
If i enter "BABY CREAM" firstly show result about "BABY CREAM" after that "BABY" and"CREAM".

推荐答案

:doh:
在这里不能这样工作.

这是询问者的期望:
1. 先尝试您要做什么!您可能会发现它并不难.
2.制定看起来像问题/无法解决的问题.

试试看,告诉他们是否遇到问题.
成员将很乐意为您提供帮助.



了解如何编写SP: MSDN:创建过程(Transact-SQL) [ ^ ]
:doh:
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it''s not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.



Learn on how to write SP''s: MSDN: CREATE PROCEDURE (Transact-SQL)[^]


请检查以下文章:

http://www.mssqltips.com/sqlservertip /1382/expand-search-capabilities-with-the-sql-server-freetext-command/ [ http://www.mssqltips.com/sqlservertip/1342 /full-text-search-querying-alternatives-in-sql-server/ [
please check the following article:

http://www.mssqltips.com/sqlservertip/1382/expand-search-capabilities-with-the-sql-server-freetext-command/[^]

http://www.mssqltips.com/sqlservertip/1342/full-text-search-querying-alternatives-in-sql-server/[^]


这篇关于从多列中搜索记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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