Fetch all the columns from table artists
with id
among (1, 2, 3) and with the arbitrary order (2, 3, 1)
# Option 1
select * from artists join (values(1, 2), (2, 3), (3, 1)) as t (id, ordering) using (id) order by ordering;
# Option 2
select * from artists join unnest(array[2, 3, 1]) WITH ORDINALITY t(id, ordering) using (id) order by ordering;