Skip to content

Instantly share code, notes, and snippets.

@egulhan
Created April 15, 2015 12:10
Show Gist options
  • Select an option

  • Save egulhan/8eee6a38fdf58924ead5 to your computer and use it in GitHub Desktop.

Select an option

Save egulhan/8eee6a38fdf58924ead5 to your computer and use it in GitHub Desktop.
Get sorted items while using IN operator
select *
from items
where item_id in (1,3,5,7,2,4,6,8)
order by field(item_id, 1,3,5,7,2,4,6,8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment