Last active
July 12, 2017 16:49
-
-
Save nomoney4me/08a4a7ae99f8b676464e8b1f0babf6af to your computer and use it in GitHub Desktop.
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
Promise.try(() => { | |
return Promise.all([ | |
knex('course_requests').select('*'), | |
knex.raw('select distinct(CourseTitle) as courses from course_requests group by CourseTitle') | |
]) | |
}).then(([allrecords, rows]) => { | |
console.log(rows) | |
}) | |
/* Console.log(rows) | |
[ | |
RowDataPacket { courses: 'French I' }, | |
RowDataPacket { courses: 'French II' }, | |
RowDataPacket { courses: 'French III' }, | |
RowDataPacket { courses: 'French III Honors' }, | |
RowDataPacket { courses: 'French IV' }, | |
RowDataPacket { courses: 'French V' }, | |
RowDataPacket { courses: 'G Block Free' }, | |
... | |
] | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment