CREATE FUNCTION `NewProc`(format_vale VARCHAR(100))
RETURNS varchar(100)
BEGIN
DECLARE dec_number VARCHAR(4000)
DECLARE dec_number_vale VARCHAR(4000)
SET dec_number = ''
SET dec_number_vale = CAST(format_vale AS CHAR)
WHILE dec_number_vale IS NOT NULL DO
-- 剪切字符串
SET dec_number = right(dec_number_vale,1)
IF dec_number = '0' || dec_number= '.' THEN
SET dec_number_vale = LEFT(dec_number_vale ,LENGTH(dec_number_vale)-1)
ELSE
RETURN dec_number_vale
END IF
END WHILE
END
DECLARE @i INT DECLARE @n INT DECLARE @t VARCHAR(20) SET @t='' SET @i=0 SELECT @n=len(sr1) FROM ts_2 --PRINT @n WHILE @i欢迎分享,转载请注明来源:内存溢出
评论列表(0条)