Ordering SQL query by specific field values
Order By Case Edition
When 'NE' Then 1
When 'OE' Then 2
When 'OP' Then 3
Else 4 End
SELECT
/*other fields*/
CASE WHEN 'NE' THEN 1
WHEN "OE" THEN 2
WHEN "OP" THEN 3
ELSE 4
END AS OrderBy
FROM
/*Tables*/
WHERE
/*conditions*/
ORDER BY
OrderBy,
/*other fields*/