在Oracle中在十进制后追加'0'

man*_*ish 4 sql oracle to-char

我想在执行Select查询时将尾随'0'附加到数字:

我想要的是选择

344.89为344.890

123213.45为123213.450

1.2为1.200

我尝试使用, to_char(col_name,'000000.000')但结果导致

344.89 => 000344.890

123213.45 => 123213.450

1.2 => 000001.200

结果中附加了不需要的"0".

Gor*_*off 8

你接近to_char格式.试试这个:

to_char(col_name,'999999.000')
Run Code Online (Sandbox Code Playgroud)

9s为可选的占位符.该0s为投入前导零.