Created
June 29, 2020 19:21
-
-
Save moogle19/4d17f14a36eb7eb69228d67160fec37b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from( | |
v in Fnord, | |
select: [:id], | |
where: v.id in [9026, 9025, 9024, 9021, 9020, 9019], | |
join: t in fragment("select * from unnest('{9026, 9025, 9024, 9021, 9020, 9019}'::int[]) WITH ORDINALITY t(id, ord)"), | |
on: t.id == v.id, | |
order_by: t.ord | |
) |> Repo.all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment