select * from(select a.*,rownum r from (select f.f_filename,count(f.f_filename) as amount,trunc(ratio_to_report(COUNT(1)) OVER()*100,2) as proportion from tb_busirecord b inner join tb_ex_train_file f on b.remark = f.f_id where b.Optcode = 'QUERYFILE' group by f.f_filename order by count(f.f_filename) desc) a ) where r<=10
请问我这条sql语句需要怎么改?才能把显示在页面的.84%变成0.84%
用to_char函数再转一次:
如:
select to_char(0.84) from dual;//输出是.84
select to_char(0.84, '0.99') from dual;//输出是0.84
9的意思是保留两位小数,如果位上没有,且可以忽略,就以空白填充
0的意思是没有的时候以0填充
to_char默认是以空白填充
如果有帮助,希望采纳