Thanks for the question, Ankur.
Asked: March 11, 2021 - 5:11 pm UTC
Last updated: March 18, 2021 - 7:28 am UTC
Version: 19.8.0.0.0
Viewed 1000+ times
Select To_Char(to_date('31-Mar-2020'), 'Wth') As A, To_Char(to_date('31-Mar-2020'), 'WTH') As B, To_Char(to_date('01-Feb-2020'), 'WWth') As C, To_Char(to_date('01-Feb-2020'), 'WWTH') As D from dual; Ouput A B C D 5th 5TH 05TH 05TH
SQL> select to_char(sysdate,'DDth') from dual; TO_C ---- 17TH SQL> select to_char(sysdate,'ddth') from dual; TO_C ---- 17th
A reader, March 17, 2021 - 5:57 am UTC
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library