久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

用于搜索“關(guān)鍵字"的表字段的 T-SQL 查詢

T-SQL query to search table-field for quot;Keywordsquot;(用于搜索“關(guān)鍵字的表字段的 T-SQL 查詢)
本文介紹了用于搜索“關(guān)鍵字"的表字段的 T-SQL 查詢的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在嘗試在我的網(wǎng)站上創(chuàng)建一個(gè)搜索文本框,而不是在提交時(shí)將字符串關(guān)鍵字"傳遞到我的網(wǎng)格中并提取該關(guān)鍵字的所有匹配記錄.

I'm trying to create a search text-box on my website than when submitted will pass the 'string-keyword' into my grid and pull all matching records for that keyword.

我必須使用 where 語句設(shè)置我的網(wǎng)格,該語句將偵聽"表單通過查詢字符串傳入的參數(shù).

I'm having to setup my grid with a where statement that will "listen" for parameters passed in by the form via query-string.

我不知道如何解決這個(gè)問題.任何見解、提示、示例表示贊賞.

I'm not sure how to approach this. Any insight, tips, examples appreciated.

更新-------這是我的網(wǎng)格用于填充記錄的查詢.除了城市/地區(qū)/國家之外,我還嘗試合并一個(gè)關(guān)鍵字搜索,它只會查看 BND_Listing 表中的公司"字段.

UPDATE------- This is the query my grid is using to populate records. In addition to City/Region/Country I'm trying to incorporate a keyword Search that would only look at my 'Company' Field inside the BND_Listing table.

select * FROM BND_listing right join BND_ListingCategories
on BND_Listing.CatID=BND_ListingCategories.CatID
where 
 (CategoryName = '[querystring:filter-Category]' or '[querystring:filter-     Category]'='All')
 and
 (City = '[querystring:filter-City]' or '[querystring:filter-City]'='All')
and
(Region= '[querystring:filter-State]' or '[querystring:filter-State]'='All')
and
(Country= '[querystring:filter-Country]' or '[querystring:filter-    Country]'='All')
and
isnull(Company,'') <> ''
ORDER by Company ASC

推薦答案

我不知道你說的監(jiān)聽"參數(shù)是什么意思,但因?yàn)槟阒挥?TSQL 標(biāo)記,匹配部分在 SQL Server 中是這樣實(shí)現(xiàn)的:

I don't know what you mean by "listen" for parameters, but since you only have TSQL tagged, the matching part in SQL Server is achieved like so:

DECLARE @param VARCHAR(256)   --or what ever size you need
SET @param = 'some text'

SELECT SomeColumns
FROM SomeTable
WHERE aColumn LIKE '%' + @param + '%'

或者在 VB 中使用 SqlCommand 你可以查看:https://stackoverflow.com/a/251311/6167855

Or using SqlCommand in VB you can check out: https://stackoverflow.com/a/251311/6167855

這篇關(guān)于用于搜索“關(guān)鍵字"的表字段的 T-SQL 查詢的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Modify Existing decimal places info(修改現(xiàn)有小數(shù)位信息)
The correlation name #39;CONVERT#39; is specified multiple times(多次指定相關(guān)名稱“CONVERT)
T-SQL left join not returning null columns(T-SQL 左連接不返回空列)
remove duplicates from comma or pipeline operator string(從逗號或管道運(yùn)算符字符串中刪除重復(fù)項(xiàng))
Change an iterative query to a relational set-based query(將迭代查詢更改為基于關(guān)系集的查詢)
concatenate a zero onto sql server select value shows 4 digits still and not 5(將零連接到 sql server 選擇值仍然顯示 4 位而不是 5)
主站蜘蛛池模板: 欧美一级在线免费 | 成人性视频免费网站 | 精品乱码久久久久 | 青草青草久热精品视频在线观看 | 国产精品二区三区 | 中文字幕亚洲一区二区va在线 | 在线观看免费观看在线91 | 在线观看的av| 色888www视频在线观看 | 黄色一级大片在线免费看产 | 久久综合一区 | 久久综合狠狠综合久久综合88 | 成人影视网 | 精品久久久久久亚洲精品 | 亚洲精品1区 | 国产传媒在线观看 | 国产一区二区三区精品久久久 | 国产一区久久精品 | 搞av.com| h视频在线观看免费 | 亚洲成人精品国产 | 亚洲成人一区二区三区 | 国产视频一二三区 | 一级在线观看 | 午夜欧美a级理论片915影院 | 国产成人av免费看 | 成人午夜免费在线视频 | 日韩精品视频在线观看一区二区三区 | 亚洲精品一区二区三区蜜桃久 | 成人精品视频免费 | 亚洲男人天堂 | 欧美九九九 | 狠狠躁天天躁夜夜躁婷婷老牛影视 | 久久久综合网 | 久久久天天 | 欧美日韩不卡合集视频 | 国产一区免费视频 | 国产黄色大片在线免费观看 | 在线观看成人 | 欧美在线一区二区三区 | 国产激情在线 |