讲座视频,郑州天气预报10天,前列腺炎如何食疗
教你用sql函数实现中文转首字母
create function dbo.fun_getpy(@str nvarchar(255)) returns nvarchar(50) as begin declare @word nchar(1),@py nvarchar(50) set @py='' while len(@str)>0 begin set @word=left(@str,1) --如果非汉字字符,返回原字符 set @py=@py+(case when unicode(@word) between 19968 and 19968+20901 then (select top 1 py from ( select 'a' as py,n'骜' as word union all select 'b',n'簿' union all select 'c',n'错' union all select 'd',n'鵽' union all select 'e',n'樲' union all select 'f',n'鳆' union all select 'g',n'腂' union all select 'h',n'夻' union all select 'j',n'攈' union all select 'k',n'穒' union all select 'l',n'鱳' union all select 'm',n'旀' union all select 'n',n'桛' union all select 'o',n'沤' union all select 'p',n'曝' union all select 'q',n'囕' union all select 'r',n'鶸' union all select 's',n'蜶' union all select 't',n'箨' union all select 'w',n'鹜' union all select 'x',n'鑂' union all select 'y',n'韵' union all select 'z',n'咗' ) t where word>=@word collate chinese_prc_cs_as_ks_ws order by py asc) else @word end) set @str=right(@str,len(@str)-1) end return @py end go select dbo.fun_getpy('中国')
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
数据库SQL---数据库、基本表、视图、索引的定义、修改、删除
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (上)
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (下)
网友评论