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

轉(zhuǎn)義括號 [ 在 CONTAINS() 子句中?

Escaping Bracket [ in a CONTAINS() clause?(轉(zhuǎn)義括號 [ 在 CONTAINS() 子句中?)
本文介紹了轉(zhuǎn)義括號 [ 在 CONTAINS() 子句中?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

如何在全文 SQL Server contains() 查詢中轉(zhuǎn)義括號?我已經(jīng)嘗試了以下所有方法,沒有有效:

How can I escape a bracket in a full-text SQL Server contains() query? I've tried all the following, none of which work:

CONTAINS(crev.RawText, 'arg[0]')
CONTAINS(crev.RawText, 'arg[[0]]')
CONTAINS(crev.RawText, 'arg\[0\]')

使用雙引號確實有效,但它強制整個搜索成為一個詞組,這是多詞查詢的一個亮點.

Using double quotes does work, but it forces the entire search to be a phrase, which is a showstopper for multiple word queries.

CONTAINS(crev.RawText, '"arg[0]"')

我真正想做的就是擺脫括號,但我似乎無法做到..

All I really want to do is escape the bracket, but I can't seem to do that..

推薦答案

您不必轉(zhuǎn)義 [,因為它在全文搜索中沒有特殊含義.但是,如果您確實需要搜索完全匹配項,則可以使用 "" 標記.

You don't have to escape the [ as it has no special meaning in Full Text Search. If you do need to search for an exact match though, you can use "" marks.

此外,您可以在單引號內(nèi)使用多個":

Further, you can use multiple "" inside the single quotes:

CONTAINS('"word1" or "word2" or "word3"')

這也有效:

CONTAINS('"word1" and "word2" and "word3"')

雙引號內(nèi)的任何內(nèi)容都被視為精確文本.因此,如果我要搜索 AdventureWorks 中 Production.ProductDescription 表的 Description 字段,我可以使用

Anything put inside the double quotes is treated as exact text. Thus if I were to do a search of the Description field of the Production.ProductDescription table in AdventureWorks, I could use

CONTAINS('shifting and "on or off-road"') 

并且它會找到與on or off-road"這個詞組匹配的詞 shift.

and it would find matches for the word shifting that also had the phrase "on or off-road".

唯一的特殊符號是 ~,它可以用來代替 NEAR 命令.

The only special symbol is the ~, it can be used in place of the NEAR command.

CONTAINS('shifting ~ smooth')

CONTAINS('shifting NEAR smooth')

and 將找到單詞 shift 和 smooth 彼此靠近的匹配項.

and will find matches where the words shifting and smooth are near each other.

這篇關(guān)于轉(zhuǎn)義括號 [ 在 CONTAINS() 子句中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

SQL trigger on Truncate(截斷時的 SQL 觸發(fā)器)
sql search query with multiple optional search parameters(具有多個可選搜索參數(shù)的 sql 搜索查詢)
SQL Efficiency: WHERE IN Subquery vs. JOIN then GROUP(SQL 效率:WHERE IN 子查詢 vs. JOIN 然后 GROUP)
Retrieving XML element name using t-SQL(使用 t-SQL 檢索 XML 元素名稱)
Insert double quotes into SQL output(在 SQL 輸出中插入雙引號)
Delete rows from CTE in SQL SERVER(從 SQL SERVER 中的 CTE 中刪除行)
主站蜘蛛池模板: 伊人在线 | 黄色网址在线播放 | 日韩成人在线播放 | 亚洲一区二区综合 | 一区二区三区四区日韩 | 久久精品国产一区二区三区 | 夜夜爽99久久国产综合精品女不卡 | 中文字幕乱码一区二区三区 | 天天搞天天操 | www九色 | 日日草天天干 | 热99视频| 狠狠操狠狠搞 | 免费观看一级特黄欧美大片 | www国产精品 | 久久久久国产一区二区三区 | 日日骚av | 亚洲综合无码一区二区 | 亚洲欧美一区二区三区1000 | 国产一区二区在线视频 | 黑人巨大精品欧美一区二区免费 | 国产成人免费 | 97精品一区二区 | 免费久久99精品国产婷婷六月 | 伦理一区二区 | 国产精品激情在线 | 成人欧美一区二区三区黑人孕妇 | 国产亚洲一区二区三区在线观看 | 三级成人片 | 美女精品一区 | 亚洲一区在线日韩在线深爱 | 国产乱码精品一区二区三区五月婷 | 精品久久久久一区二区国产 | 精品久久精品 | 一区二区精品在线 | 亚洲精品v | 中文字幕在线第二页 | 久久91精品国产一区二区 | 欧美一级在线 | 激情免费视频 | 一区视频在线 |