Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[Ecto] SELECT AS bookshelf_id, COUNT( AS books_count FROM bookshelf JOIN book ON = book.bookshelf_id GROUP BY
from(bookshelf in Bookshelf,
join: book in Book, on == book.bookshelf_id,
select: %{bookshelf_id:, books_count: count(}
) |> Repo.all()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment