Created
August 1, 2018 13:34
-
-
Save lakesare/6e293901e986890b3aa622ff9f6700bc to your computer and use it in GitHub Desktop.
group_by sql vs js
This file contains 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 COUNT(MOVIES.ID), MOVIES.DIRECTOR | |
FROM MOVIES | |
GROUP BY MOVIES.DIRECTOR | |
movies = [{ id: 5, director: 'a' }, { id: 8, director: 'a' }, { id: 3, director: 'b' }] | |
//=> [{ amount: 2, director: 'a' }, { amount: 1, director: 'b' }] | |
function group_by(field){ | |
} | |
movies.group_by() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment