LMSouq
database Open

How to define a custom ORDER BY order in mySQL

MU
Muleskinner
1 month ago
3 views
Problem Description
In MySQL how do I define a custom sorting order. To try to explain what I want consider this table: ID Language Text 0 ENU a 0 JPN b 0 DAN c 1 ENU d 1 JPN e 1 DAN f 2 etc... here I want to return all rows sorted by Language and ascending ID so that Language = ENU comes first, then JPN and lastly DAN. The result should be: a,d,b,e,c,f etc. Is this even possible?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base