The ToChar (sysdate, ' D ') function was encountered while learning Oracle, but the discovery was not a day of the week, as today is 20150317, Tuesday, but the resulting value is 3
Started thinking it was the system date what's the reason that tried
Select To_char (to_date (' 20150317 ', ' yyyymmdd '), ' D ') from dual; the resulting value is still 3.
Search a lot of information only found that the 3 here and we understand that the 3 is not a concept, here 3 is the first day of one weeks, the foreign is Sunday count one weeks third days, so do not mix with the week.
Later found that there are several other optional parameters, put together for easy memory understanding, as follows:
Select To_char (sysdate, ' D ') from dual; The first day of the week
Select To_char (sysdate, ' DD ') from dual; the first day of the month
Select To_char (sysdate, ' DDD ') from dual; the first day of this year
Oracle:tochar (sysdate, ' D ') function