title: SQL to get between conditions based on row values
body: <p>OK crappy title, but I have a table with between conditions as rows.</p>
  
  <pre><code>id  | Value |  ValueMax
   1        0       49000
   2    50000       70000  
  </code></pre>
  
  <p>The easy part is comparing a value and returning one of the rows.  The part that breaks is that if it goes over the ValueMax, in this case the 70000, it should return that row.  But the simple condition x > ValueMax also satisfies the other row and both are returned.  What am I missing.   </p>