Skip to content

Instantly share code, notes, and snippets.

@gebv
Created December 29, 2015 07:37
Show Gist options
  • Save gebv/884375916d03ee02cd2e to your computer and use it in GitHub Desktop.
Save gebv/884375916d03ee02cd2e to your computer and use it in GitHub Desktop.
Сортировка результата по произвольному списку
SELECT * FROM classifer WHERE classifer_id IN (60,61,59) ORDER BY position(classifer_id::text in '60, 61, 59')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment