I want to remove leading zeroes from results. And I found an answer here How to remove leading zeroes from day and month values in Oracle, when parsing to a string using a to_char function? , but it does not work for me.
I tried the script as following:
SELECT TO_CHAR(SYSDATE, 'dd.mm.yyyy'),
TO_CHAR(SYSDATE - 20, 'fmdd-fmmm-yyyy')
FROM DUAL;
I got the result as following:
31.08.2018 | 11-08-2018
Then I tried :
SELECT TO_CHAR(SYSDATE, 'dd.mm.yyyy'),
TO_CHAR(SYSDATE - 20, 'fmMM')
FROM DUAL;
It seems to get the right result :
31.08.2018 | 8
So how can I remove leading zeroes from day and month values in Oracle? What's wrong with me?