Skip to content

SELECT: SUM

Ali Amirnezhad edited this page Jul 23, 2019 · 2 revisions
const query = myQueryBuilder
    .SELECT({ $SUM: 'field' })
    .from('table')
    .get();

// SELECT SUM(`field`) FROM `table`
const query = myQueryBuilder
    .SELECT({ $SUM: { field: 'fieldSUM' } })
    .from('table')
    .get();

// SELECT SUM(`field`) AS `fieldSUM` FROM `table`
Clone this wiki locally