Skip to content
Advertisement

How order by case and order too?

i have a query for my next table

This could be the sql query :

but now i need order by case: example: when 'Scholar' then 1 desc

its possible do that?

my goal is order by id, and by case type example:

the result will be:

Advertisement

Answer

Your question suggests that want a new direction within each group:

However, your example suggests that you just want a second order by key, id desc.

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