Get the App
SLTechnology News&Howtos  ›  Database  › 

How to obtain the Pinyin consonant of Chinese character string in sqlServer

Shulou Source: shulou.com Published: 2022-05-31 20:00:13 10月02日 Update

How to get the pinyin consonant of Chinese character string in sqlServer, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

CREATE function fGetPy (@ str varchar) ='') returns varchar as begin declare @ strlen int,@return varchar, @ ii int declare @ c nchar (1), @ chn nchar (1) select @ strlen=len (@ str), @ return='' @ ii=0 set @ ii=0 while @ ii=' A 'select @ c = char (count (*) + 63) from (select top 27 * from (select chn =' A 'union all select' 8 'union all select' ZAM 'union all select' union all select''union all select' hair 'union all select', 'union all select' hafnium 'union all select'-- because have no 'i'union all select 'not' union all select 'union all select', 'union all select' union all' Select 'union all select' Oh, 'union all select', 'union all select', three 'union all select,' he 'union all select', no'u' union all select','no'v 'union all select', 'union all select' union all select, 'union all select', 'union all select @ chn) as an order by chn COLLATE Chinese_PRC_CI_AS) as b where b.chn

Tags: Questions initial consonants pinyin Chinese characters more help answers easy easy content guys partners methods knowledge articles industry information channels channels analysis Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Xiaomi MariaDB Shulou Information