Last active
December 12, 2016 20:34
-
-
Save mezod/ddc3c29be764e44f79f11c7da00d3b9a to your computer and use it in GitHub Desktop.
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
knex('events').select() | |
.where(knex.raw('events.user_id = users.id')) | |
.sum('upvotes') | |
.as('numupvotes') | |
.count() | |
.as('numevents') |
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
knex('events').select() | |
.where(knex.raw('events.user_id = users.id')) | |
.sum('upvotes') | |
.as('numupvotes'), | |
.count() | |
.as('numevents'), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment