Skip to content

Instantly share code, notes, and snippets.

@cloud8421
Created April 22, 2015 13:40
Show Gist options
  • Save cloud8421/3c3005148652310f926c to your computer and use it in GitHub Desktop.
Save cloud8421/3c3005148652310f926c to your computer and use it in GitHub Desktop.
Count query in Ecto
# Given a Message model with a body column
from(m in Message, select: count(m.body)) |> Repo.one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment