How can I sort by a table column in varying cases (Oracle)

前端 未结 5 1188

How can I sort a table with a column of varchar2 with characters in varying cases (UPPER and lower)?

For example, when I do an order by

5条回答
  •  后悔当初
    2021-02-12 11:21

    Use lower(field), e.g.

    select * from tbl order by lower(name)
    

    If you need to address special characters for non-english languages then the other answers about NLSSORT may be what you need. If you don't I would try and KISS and use lower() as it is very easy to remember and use and be read by others (maintainability).

提交回复
热议问题