Skip to content

SELECT: RPAD

Ali Amirnezhad edited this page Jul 24, 2019 · 1 revision
const query = myQueryBuilder
    .SELECT({ $RPAD: 'field', $ARGS: [10, '$string'] })
    .from('table')
    .get();

// SELECT RPAD(`field`, 10, 'string') FROM `table`
const query = myQueryBuilder
    .SELECT({ $RPAD: 'name', $ARGS: [10, '$ '] })
    .from('table')
    .get();

// SELECT RPAD(`name`, 10, ' ') FROM `table`
const query = myQueryBuilder
    .SELECT({ $RPAD: { field: 'fieldRPAD' }, $ARGS: [10, '$string'] })
    .from('table')
    .get();

// SELECT RPAD(`field`, 10, 'string') AS `fieldRPAD` FROM `table`
const query = myQueryBuilder
    .SELECT({ $RPAD: { name: 'nameRPAD' }, $ARGS: [10, '$ '] })
    .from('table')
    .get();

// SELECT RPAD(`name`, 10, ' ') AS `nameRPAD` FROM `table`
Clone this wiki locally