Last active
December 14, 2015 23:49
-
-
Save iaintshine/50ea0fe951d8144812a0 to your computer and use it in GitHub Desktop.
Query List Comprehesion compared to Active Record
This file contains hidden or 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
| mnesia:transaction( | |
| fun() -> | |
| qlc:e( | |
| qlc:q( [ { U#name, U#reputation } || | |
| U <- mnesia:table(users), | |
| U#user.age < 21]) | |
| ) | |
| end | |
| ) |
This file contains hidden or 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
| Users.select("name, reputation"), where("age < 21") |
This file contains hidden or 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
| 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