Skip to content
Advertisement

Order by case insensitive in oracle

I want to order a following text in following order but, after trying the following query it is not working.

values to order is “A”, “B”, “Y”, “Z”, “a”, “b”, “y”, “z”.

Expected result “ZzYyBbAa”

Advertisement

Answer

First of all, you can order by the UPPER (or LOWER) case of the column, but once you’ve done that, you then need to sort by the text itself to get the order on the initial letter; eg:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement