title: how to compare the rows of a table using python
body: <p>Sorry if the title was misleading or not very descriptive, but here is what I want
  I have a table with 2 columns :</p>
  
  <pre><code>name|value
  1.aaaa|132412
  2.aaaa|234124
  3.aaaa|542253
  bbbb|234324
  bbbb|342342
  </code></pre>
  
  <p>so I want to basically compare the rows where name="aaaa"
  the part where I am stuck is how do I compare all the rows with name="aaaa"</p>
  
  <pre><code>sql="select value from table where name='aaaa'"
  cursor.execute(sql)
  result=cursor.fetchall()
  for row in result:
    value=row[0]
  </code></pre>
  
  <p>how do I go about from here ?</p>
  
  <p>edit: 
  I want to compare value of 1 with 2,1 with 3 and similarly 2 with 3 and so on..</p>