title: Compare rows in same table in mysql
body: <p>I have a mysql table like below</p>
  
  <pre><code>id   trader price
  111  abc    5 
  222  xyz    5.20 
  333  abc    5.70 
  444  xyz    5 
  555  abc    5.20 
  </code></pre>
  
  <p>I need to compare row 1's price with row 2's price and accroding to the given sample row 2's price is less than row 1's price which means that trader xyz increased the price once, and in the same way when we compare row 2's price with row 3's price where row 3's price is higher than row 2's price which means trader abc also increased the price once. So in this manner I need to compare the entire table and find how many times each trader increased or decreased price...</p>
  
  <p>I dont have any idea to do this, can someone please help me on this</p>