Skip to content
Advertisement

Oracle SQL – Custom Sort

I have a scenario where I have following data:

Table: Locations

I want to sort in a way that all the IDs that end in ‘0000’ should be sorted first, then the TYPE ‘Warehouse’ and then the rest of the Stores.

The desired output should be like

How do I do this custom sorting?

Advertisement

Answer

This is how I understood the problem; sample data till line #7; query begins at line #8.

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