title: MySql - How get value in previous row and value in next row?
body: <p>I have the following table, named <code>Example</code>:</p>
  
  <pre><code>id(int 11) //not autoincriment
  value (varchar 100)
  </code></pre>
  
  <p>It has the following rows of data:</p>
  
  <pre><code>0  100
  2  150
  3  200
  6  250
  7  300
  </code></pre>
  
  <p>Note that id values are not contiguous.</p>
  
  <p>I've written this SQL so far:</p>
  
  <pre><code>SELECT * FROM Example WHERE id = 3
  </code></pre>
  
  <p>However, I don't know how to get the value of previous <code>id</code> and value of the next <code>id</code>...</p>
  
  <p>Please help me get previous value and next value if <code>id</code> = 3 ?</p>
  
  <p><em>P.S.: in my example it will be: previous - <code>150</code>, next - <code>250</code>.</em></p>