日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MSSQL中使用子字符串查找的實(shí)現(xiàn)(mssql子字符串查找)

Substring Location in MSSQL

創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供柳州網(wǎng)站建設(shè)、柳州做網(wǎng)站、柳州網(wǎng)站設(shè)計(jì)、柳州網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、柳州企業(yè)網(wǎng)站模板建站服務(wù),十載柳州做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。

In Microsoft SQL Server, a substring is a portion of a character string, typically consisting of one or more characters. It may be used to select some or all characters in a string. You can get the start or location of a substring within a character string in Microsoft SQL Server using the charindex() function. The charindex() function searches a certain character string (called the search string) within another character string and returns the start location of the search string, or 0 if the search string characters cannot be found.

For example, you may have a character string “Microsoft SQL Server” and you want to find the starting position of the substring “SQL”. The following statement can be used:

SELECT CHARINDEX(‘SQL’, ‘Microsoft SQL Server’)

The above statement returns 10 because the keyword “SQL” is located at the 10th character in the character string.

The charindex() function also works with Unicode and extended ASCII characters.

The charindex() function provides several additional argument options for more advanced substring query/search. For example, the third argument of the charindex() function specifies the starting position in the character string from which the search begins. The following statement returns the location of the substring “SQL” starting from the 11th character:

SELECT CHARINDEX(‘SQL’, ‘Microsoft SQL Server’, 11)

The fourth argument allows the substring search case to be specified. It is set to false by default, which means that case is ignored. To perform a case-sensitive search, it should be set to true.

SELECT CHARINDEX(‘SQL’, ‘Microsoft SQL Server’, 0, true)

The charindex() function can be used with other string manipulation functions to perform various tasks such as extracting a substring of a larger string. It can also be used in combination with other data manipulation language (DML) statements such as SELECT, UPDATE, and DELETE to perform complex operations on string data.

In summary, the charindex() function allows a substring location to be quickly and easily retrieved in MSSQL. It provides both basic and advanced options for substring string manipulation.

香港服務(wù)器選創(chuàng)新互聯(lián),2H2G首月10元開通。
創(chuàng)新互聯(lián)(www.cdcxhl.com)互聯(lián)網(wǎng)服務(wù)提供商,擁有超過10年的服務(wù)器租用、服務(wù)器托管、云服務(wù)器、虛擬主機(jī)、網(wǎng)站系統(tǒng)開發(fā)經(jīng)驗(yàn)。專業(yè)提供云主機(jī)、虛擬主機(jī)、域名注冊、VPS主機(jī)、云服務(wù)器、香港云服務(wù)器、免備案服務(wù)器等。


本文題目:MSSQL中使用子字符串查找的實(shí)現(xiàn)(mssql子字符串查找)
文章源于:http://m.5511xx.com/article/coejcpc.html