Skip to content
Advertisement

MySQL sorting single field in multi orders

hi i am trying to sort a field with multiple orders for example here is my table

1st rule is to sort by Status. in following order: Active, Inactive, Merged, Promo A, Promo B, Promo C, Promo D, Defunct

Once they are sorted like this within each of these categories the 2nd rule in following Order: Traditional, Native, Salvation, Amm, Nav

3rd rule is to sort by the State within These categories By Alphabetical A-Z

if i cannot do this in mysql so can i do this in php? with sort function

i just need an idea or trick how i can do this thanks for help

JavaScript

Advertisement

Answer

use case

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