The format_mask parameter begins with "FM". This means that zeros and blanks are suppressed. This can be seen in the examples below.
to_char(sysdate, 'FMMonth DD, YYYY'); would return 'July 9, 2003'
to_char(sysdate, 'FMMON DDth, YYYY'); would return 'JUL 9TH, 2003'
to_char(sysdate, 'FMMon ddth, YYYY'); would return 'Jul 9th, 2003'
The zeros have been suppressed so that the day component shows as "9" as opposed to "09".
[@more@]/*
FM :除空格
9999999.0099:允许小数点左边最大正数为7位,小数点右边最少2位,最多4位,且在第5位进行四舍五入
*/
Select TO_CHAR(123.0233,'FM9999999.0099') FROM DUAL
SELECT TO_CHAR('100','fm0000') FROM dual
-----
0100
1 row selected.
SELECT TO_CHAR('100','fm9999') FROM dual
-----
100
1 row selected.
SELECT TO_CHAR(SYSDATE,'yyyymmdd') FROM dual;
--------
20090813
1 row selected.
SELECT TO_CHAR(SYSDATE,'fmyyyymmdd') FROM dual;
--------
2009813
1 row selected.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/640706/viewspace-1025243/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/640706/viewspace-1025243/