title: How to get previous row value
body: <p>How to get a value from previous result row of a SELECT statement</p>
  
  <p>If we have a table called cardevent and has rows [ID(int) , Value(Money) ] and we have some rows in it, for example</p>
  
  <pre><code>ID --Value
  
  1------70 
  1------90
  2------100
  2------150
  2------300 
  3------150 
  3------200 
  3-----250 
  3-----280
  </code></pre>
  
  <p>so on...</p>
  
  <p>How to make one Query that get each row ID,Value and the previous Row Value in which data appear as follow</p>
  
  <pre><code>ID --- Value ---Prev_Value
  
  1 ----- 70 ----------  0 
  1 ----- 90 ---------- 70
  2 ----- 100 --------  90 
  2 ------150 -------- 100
  2 ------300 -------- 150
  3 ----- 150 -------- 300 
  3 ----- 200 -------- 150 
  3 ---- 250 -------- 200 
  3 ---- 280 -------- 250
  </code></pre>
  
  <p>so on.</p>
  
  <p>So can anyone help me to get the best solution for such a problem ?</p>
  
  <p>Need Query Help</p>