CREATE OR REPLACE FUNCTION to_percent (a in number,b in number) return varchar2 is c varchar2(20); begin if(a=0 or b=0) then c:='0'; else c:= trunc(a*100/b,2)||'%'; end if ; return c; end; /
Oracle 根据两个数获取百分比的函数
最新推荐文章于 2023-07-06 17:04:20 发布
CREATE OR REPLACE FUNCTION to_percent (a in number,b in number) return varchar2 is c varchar2(20); begin if(a=0 or b=0) then c:='0'; else c:= trunc(a*100/b,2)||'%'; end if ; return c; end; /