Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aaronmcadam/582552 to your computer and use it in GitHub Desktop.

Select an option

Save aaronmcadam/582552 to your computer and use it in GitHub Desktop.
ordering a list of items but not in alphabetical order
SELECT `Name`, `Rating`, `City`, `Country`, `Displayed`, REPLACE(REPLACE(REPLACE(`Rating`,'Gold','1'),'Silver','2'),'Bronze','3') as `ratingNum` FROM `table` WHERE `Displayed` = 'Yes' ORDER BY `ratingNum`,`Name` ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment