使用9的话, 会根据9的个数,补空格。 当然还会加上一个+/-的符号占位。 所以是一个符号空格加上一个因为9的个数补充的空格加上一个【1】一共是三位。 看这段话,这是oracle光访文档 ------------------------- Returns value with the specified number of digits with a leading space if positive or with a leading minus if negative. Leading zeros are blank, except for a zero value, which returns a zero for the integer part of the fixed-point number.
也就是说如果是 select 'XX' || to_char(-1,'99') from dual 结果:XX -1select 'XX' || to_char(-10,'99') from dual 结果:XX-10select 'XX' || to_char(10,'99') from dual 结果:XX 10
------------------------
luoyoumou 1已选择 1 行。-- 这样看,你就明白啦!
刚查到了楼主看看
http://hi.baidu.com/luanjy/blog/item/8cc47089eb1c0ab50f244438.html
会根据9的个数,补空格。
当然还会加上一个+/-的符号占位。
所以是一个符号空格加上一个因为9的个数补充的空格加上一个【1】一共是三位。
看这段话,这是oracle光访文档
-------------------------
Returns value with the specified number of digits with a leading space if positive or with a leading minus if negative.
Leading zeros are blank, except for a zero value, which returns a zero for the integer part of the fixed-point number.
select 'XX' || to_char(-1,'99') from dual
结果:XX -1select 'XX' || to_char(-10,'99') from dual
结果:XX-10select 'XX' || to_char(10,'99') from dual
结果:XX 10