Skip to content
Advertisement

Order by stored procedure parameter

I have a problem ordering my stored procedure by a parameter given by a user, I have tried reading but the solutions I have tried won’t work.

So, is there somebody who can help me? I would like it to be sorted by Type from my Group_concat. It works if I type it in harcoded, like (ORDER BY Type1, ORDER BY Type2 and so on). But I would like something like this (ORDER BY @specificStat).

Advertisement

Answer

Use this instead:

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