How to programmatically use the "between" operator in Drupal Views I have a price field and I want to see if the value of this field is between multiple price segments.

E.g.: (price BETWEEN 0 AND 100) OR (price BETWEEN 150 AND 200)

So how can I use the "between" operator in Drupal Views to programmatically alter a query?
I believe you are using hook_views_query_alter. So see the example to add OR in condition. Check out code : 

$this-&gt;query-&gt;add_where(
  $this-&gt;options['group'],
    db_or()
      -&gt;condition($field, array(0, 100), 'BETWEEN')
      -&gt;condition($field, array(150, 200), 'BETWEEN')
  );