When I’m storing a list of items, along with the ordering that’s been manually assigned, I normally do it like so
SELECT animal, preference FROM favourite_animals ORDER BY preference ASC
animal |preference
---------------------------
dog | 1
goat | 2
monkey | 3
unicorn | 4
But it does get a bit cumbersome when changing the order, as you obviously have to also change the order of any items being displaced. But I really can’t think of another way. It’s not the worlds most pressing problem, but any ideas an another way to store this kind of data?