成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

sqlserver拼音檢索函數(shù),sql生成拼音碼

sqlserver 中有沒有檢索指定字符出現(xiàn)的次數(shù)的函數(shù)

沒有

創(chuàng)新互聯(lián)建站專注于團(tuán)風(fēng)企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,成都做商城網(wǎng)站。團(tuán)風(fēng)網(wǎng)站建設(shè)公司,為團(tuán)風(fēng)等地區(qū)提供建站服務(wù)。全流程按需求定制開發(fā),專業(yè)設(shè)計,全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)建站專業(yè)和態(tài)度為您提供的服務(wù)

你可以嘗試這樣

declare @searchstr varchar(max)

declare @valuestr varchar(max)

declare @index int

--結(jié)果表達(dá)試出現(xiàn)次數(shù)

declare @count int

--要搜索的表達(dá)式

set @searchstr = '111111abc2222222abc333333abc44444555'

--搜索表達(dá)試

set @valuestr = 'abc'

set @count = 0

select @index = charindex(@valuestr,@searchstr,0)

while @index0

begin

set @count = @count + 1

select @searchstr = substring(@searchstr,@index+len(@valuestr),len (@searchstr))

select @index = charindex(@valuestr,@searchstr,0)

end

select @count

sqlserver語句或者excel公式提取品名漢字拼音碼首字母

要是表格里沒有拼音的話不可能直接根據(jù)中文提取首字母的。EXCEL和SQL還沒智能化到如此

sql中怎么根據(jù)漢字的拼音首字母查詢

--?SQLServer:

---測試數(shù)據(jù)---

if?object_id('[pactinfo]')?is?not?null?drop?table?[pactinfo]

go

create?table?[pactinfo]([ID]?int,[pactname]?varchar(4))

insert?[pactinfo]

select?1,'正常'?union?all

select?2,'中國'?union?all

select?3,'做飯'?union?all

select?4,'加發(fā)'

---引用前輩們的一個函數(shù)---

create?function???f_GetPy(@str???nvarchar(4000))?

returns???nvarchar(4000)?

as?

begin?

declare???@strlen???int,@re???nvarchar(4000)?

declare???@t???table(chr???nchar(1)???collate???Chinese_PRC_CI_AS,letter???nchar(1))?

insert???into???@t(chr,letter)?

select???'吖?',?'A?'???union???all???select???'八?',?'B?'???union???all?

select???'嚓?',?'C?'???union???all???select???'咑?',?'D?'???union???all?

select???'妸?',?'E?'???union???all???select???'發(fā)?',?'F?'???union???all?

select???'旮?',?'G?'???union???all???select???'鉿?',?'H?'???union???all?

select???'丌?',?'J?'???union???all???select???'咔?',?'K?'???union???all?

select???'垃?',?'L?'???union???all???select???'嘸?',?'M?'???union???all?

select???'拏?',?'N?'???union???all???select???'噢?',?'O?'???union???all?

select???'妑?',?'P?'???union???all???select???'七?',?'Q?'???union???all?

select???'呥?',?'R?'???union???all???select???'仨?',?'S?'???union???all?

select???'他?',?'T?'???union???all???select???'屲?',?'W?'???union???all?

select???'夕?',?'X?'???union???all???select???'丫?',?'Y?'???union???all?

select???'帀?',?'Z?'?

select???@strlen=len(@str),@re=?'?'?

while???@strlen?0?

begin?

select???top???1???@re=letter+@re,@strlen=@strlen-1?

from???@t???a???where???chr?=substring(@str,@strlen,1)?

order???by???chr???desc?

if???@@rowcount=0?

select???@re=substring(@str,@strlen,1)+@re,@strlen=@strlen-1?

end?

return(@re)?

end?

---查詢---

select?

*?

from?

[pactinfo]

where

left(dbo.f_GetPy(pactname),1)='Z'

---結(jié)果---

ID??????????pactname?

-----------?--------?

1???????????正常

2???????????中國

3???????????做飯

(所影響的行數(shù)為?3?行)

新聞標(biāo)題:sqlserver拼音檢索函數(shù),sql生成拼音碼
URL標(biāo)題:http://jinyejixie.com/article42/dsecjhc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、網(wǎng)站收錄、Google小程序開發(fā)、服務(wù)器托管、響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營
班戈县| 兰西县| 静海县| 金阳县| 西藏| 兴海县| 汝城县| 贵溪市| 英超| 邓州市| 三原县| 五大连池市| 广丰县| 衡山县| 平远县| 合水县| 阳泉市| 如皋市| 东山县| 阳春市| 卢湾区| 怀远县| 东乡县| 商都县| 互助| 治县。| 罗源县| 麦盖提县| 吕梁市| 元江| 永城市| 柯坪县| 隆安县| 富阳市| 远安县| 贵溪市| 屯昌县| 忻州市| 集安市| 兴业县| 天全县|