Change record status: 
Project: 
Introduced in branch: 
8.2.x
Introduced in version: 
8.2
Description: 

Adding support for the database operator "NOT BETWEEN". The operator "NOT BETWEEN" is the logical negation of the operator "BETWEEN". "BETWEEN" is defined as higher or equal as the low border and lower or equal as the high border ("X BETWEEN Y AND Z" is equivalent to "X>=Y AND X<=Z"). "NOT BETWEEN" is defined as lower as the low border or higher as the high border ("X NOT BETWEEN Y AND Z" is equivalent to "X<Y XOR X>Z"). Notice that the borders are not part of the operator "NOT BETWEEN".

$result = db_select('test', 't')
  ->fields('t', array('job'))
  ->condition('age', array(25, 26), 'NOT BETWEEN')
  ->execute();
Impacts: 
Site builders, administrators, editors
Module developers