Skip to content

Instantly share code, notes, and snippets.

@iaintshine
Last active December 14, 2015 23:49
Show Gist options
  • Save iaintshine/50ea0fe951d8144812a0 to your computer and use it in GitHub Desktop.
Save iaintshine/50ea0fe951d8144812a0 to your computer and use it in GitHub Desktop.
Query List Comprehesion compared to Active Record
mnesia:transaction(
fun() ->
qlc:e(
qlc:q( [ { U#name, U#reputation } ||
U <- mnesia:table(users),
U#user.age < 21])
)
end
)
Users.select("name, reputation"), where("age < 21")
SELECT name, reputation WHERE age < 21 FROM Users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment