1、创建测试表,
create table test_num(id number, value number);
2、插入测试数据
insert into test_num values(1,15);
insert into test_num values(2,13);
insert into test_num values(3,13.2325);
insert into test_num values(4,15.7681);
commit;
3、查询表中数据,select t.*,rowid from test_num t;
4、编写sql,保留2位小数,如果整数 后面补0;
select t.*,
case
when not regexp_like(round(value, 2), '\D') then
round(value, 2) || '.00'
else
to_char(round(value, 2))
end as value2
from test_num t;
后面没有补0
追答你确定?
本回答被提问者采纳