title: Check if Integer is between a range of column values
body: <p>Consider the following table schema:</p>
  
  <pre><code>----------------------------------
  |  ID  |  MinValue  |  MaxValue  |
  ----------------------------------
  |  1   |      0     |    10      |
  |  2   |     11     |    20      |
  |  3   |     21     |    30      |
  </code></pre>
  
  <p>I want to be able to pass an integer, and have it return the appropriate ID where that value matches the range between Min and Max Value.</p>
  
  <p>EG:</p>
  
  <pre><code>Input = 17
  Output = 2
  
  Input = 4
  Output = 1
  
  Input = 26
  Output = 3
  </code></pre>
  
  <p>I thought I could do something like:</p>
  
  <pre><code>SELECT ID FROM MyTable WHERE MinValue &gt;= @input AND MaxValue &lt;= @input
  </code></pre>
  
  <p>But it doesn't work, nothing is returned.</p>
  
  <p>I'm sure the solution is blatantly simple, but i'm stumped. </p>
  
  <p>What's the best way to achieve this in SQL Server?</p>