DELIMITER $$ DROP FUNCTION IF EXISTS `Fun_GetPY`$$ CREATE FUNCTION `HIS`.`Fun_GetPY` (in_string VARCHAR(21845)) RETURNS VARCHAR(21845) CHARSET utf8 BEGIN #截取字符串,每次做截取后的字符串存放在该变量中,初始为函数参数in_string值 DECLARE tmp_str VARCHAR(21845) CHARSET gbk DEFAULT ''…
从网络上收刮了一些,以备后用 create function fun_getPY(@str nvarchar()) returns nvarchar() as begin declare @word nchar(),@PY nvarchar() set @PY='' begin ) --如果非汉字字符,返回原字符 and + then ( PY from ( select 'A' as PY,N'驁' as word union all select 'B',N'簿' union all sel…