Skip to content

WHERE: NOT

Ali Amirnezhad edited this page Jul 24, 2019 · 1 revision
const query = myQueryBuilder
    .SELECT()
    .from('table')
    .where({ $NOT: { field: 'value' } })
    .get();

// SELECT * FROM `table` WHERE ((NOT (`field` = 'value')))
const query = myQueryBuilder
    .SELECT()
    .from('table')
    .where({ $NOT: { field: 2 } })
    .get();

// SELECT * FROM `table` WHERE ((NOT (`field` = 2)))
const query = myQueryBuilder
    .SELECT()
    .from('table')
    .where({ $NOT: { field: null } })
    .get();

// SELECT * FROM `table` WHERE ((NOT ISNULL(`field`)))
const query = myQueryBuilder
    .SELECT()
    .from('table')
    .where({ $NOT: { field: { $IN: [1, 2] } } })
    .get();

// SELECT * FROM `table` WHERE ((NOT (`field` IN (1, 2))))
Clone this wiki locally