asc
or desc
keyword in order by
clause. But if you need to display it in custom order in report, you can use the
case` expression to do it.
case
expression result below, I have used the numbers 10, 20 etc. But it does not matter. You can use number or letters in ascending order to display the result in ascending order.
If you like this SQL interview question, you may also like the below scenario based interview question and answers.