title: Select records integer between two fields
body: <p>I need to return all records for a range plus specific range agree a value (integer), but not work as I need...</p>
  
  <p>I created a table with values and part of this must return in all cases, and part of records only if between a value.</p>
  
  <p>I created a fiddle to explore it</p>
  
  <p><a href="http://sqlfiddle.com/#!9/43d802/1" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/43d802/1</a></p>
  
  <pre><code>CREATE TABLE newtable (
      nump INT NULL,
      vmin INT DEFAULT 1 NULL,
      vmax INT DEFAULT 999999 NULL
  );
  
  INSERT INTO newtable (nump, vmin, vmax) VALUES(1, 1, 999999);
  INSERT INTO newtable (nump, vmin, vmax) VALUES(2, 1, 999999);
  INSERT INTO newtable (nump, vmin, vmax) VALUES(3, 1, 999999);
  INSERT INTO newtable (nump, vmin, vmax) VALUES(4, 400, 499);
  INSERT INTO newtable (nump, vmin, vmax) VALUES(5, 500, 599);
  INSERT INTO newtable (nump, vmin, vmax) VALUES(6, 600, 999999);
  
  Select * from newtable
  where ((vmin = 1 and vmax = 999999) or 
         (vmin &gt; 1 and vmax &lt;= 408));
  </code></pre>