How to format and sort a date in Oracle?

后端 未结 7 1841
长情又很酷
长情又很酷 2021-02-19 09:50

In my application am trying to format and sort the date, i am using to_char() function to format the date to my required format, but when i sort them it is sorting

7条回答
  •  我寻月下人不归
    2021-02-19 10:20

    SELECT 
             to_char( your_date_column, your_format_mask ) as formate_purpose,
    
    FROM your_table
    
    ORDER BY to_date (formate_purpose)
    

    Try the above code

提交回复
热议问题