title: Deleting duplicate rows in sqlite?
body: <p>How to entries that have same entries?
  My table player have two aspects(name, wowp_id) that duplicate. How to merge them?</p>
  
  <p>I have been looking for related questions. The code below is build on the answers that I found. Process runs fine but duplicates remain. I would like to have no duplicate <strong>names</strong>. If there are different <strong>wowp_id</strong> for multiple <strong>name</strong> I would prefer to remove <strong>wowp_id</strong> and keep only one entry of <strong>name</strong>.</p>
  
  <pre><code>def sql_removeduplicates():
      con = sqlite3.connect('WOWT.sql')
      with con:    
          cur = con.cursor()    
          cur.execute("SELECT name, COUNT(*) FROM players GROUP BY name, team, wowp_id HAVING COUNT(*) &gt; 1")
          rows = cur.fetchall()
          con.commit()
          for row in rows:
              print row
  </code></pre>
  
  <p>my rows in players:</p>
  
  <pre><code>  (id, wowp_id, name, team)
  (108, 501078041, u'prazluges', None)
  (109, 507894244, u'Aidis', None)
  (110, 500742127, u'Aidis', None)
  (111, u'Aidis', u'Aidis', None)
  (112, u'Aidis', u'Aidis', None)
  (113, 500864543, u'prazluges', None)
  (114, u'Aidis', u'Aidis', None)
  (115, u'Aidis', u'Aidis', None)
  (116, u'Aidis', u'Aidis', None)
  (117, 501078041, u'satih', None)
  (118, u'Aidis', u'Aidis', None)
  </code></pre>