写个函数 自己调用处理就行了
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;