title: How to compare a value with two record of Oracle in the same time?
body: <p>I have a table like below:</p>
  
  <p><img src="https://i.stack.imgur.com/LPz4i.png" alt="enter image description here"></p>
  
  <p>The record of id = 1, means that value >0 and value &lt;=200.</p>
  
  <p>The record of id = 2, means that  value >200 and value &lt;=1500.</p>
  
  <p>The values are ordered by such analogy.</p>
  
  <p>Now I have a value of 4000, I want to get the corresponding id value(should be 4).</p>
  
  <p>Are there better way to write SQL compare with?</p>
  
  <p><code>select * from table_name where value &gt;=4000 and rownum = 1;</code></p>