How to format and sort a date in Oracle?

后端 未结 7 1858
长情又很酷
长情又很酷 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:27

    For sqlplus, use alter session set nls_date_format to what you want the date format to be, then just use the column name in your select statement and sort order.

提交回复
热议问题