title: Android copy values from table and insert in another
body: <p>I'm trying to copy all the data in a database table, which correspond to the WHERE clause, and insert them into another table. I'm trying this code, but in the table <code>prev</code> there are only 2 records in the table <code>Ver</code> are inserted more than 100 records .... why? </p>
  
  <pre><code>private void Tras() {
  
   String numero_ricevuto = (i.getStringExtra("numero"));
   SQLiteDatabase db = mHelper.getWritableDatabase();
   String sql = "SELECT data, unita_di_misura FROM prev WHERE numero ='"+numero_ricevuto+"'";
   Cursor c = db.rawQuery(sql, null);
   int count = c.getCount();
   String[] data = new String[count];
   String[] unita_di_misura = new String[count];
   for(int i=0; i&lt;count; i++) {
     c.moveToNext();  
     data[i] = c.getString(0);
     unita_di_misura[i] = c.getString(1);
    }            
  
    for(int i=0 ;i &lt; data.length;i++){
     ContentValues cv = new ContentValues();
     cv.put(VerTable.SI_NO, "0");
     cv.put(VerTable .DATA, data[i]);
     cv.put(VerTable .U_M, e.unita_di_misura[i]);
     db.insert(VerTable .TABLE_NAME, null, cv);
      }
   c.close();
   db.close();
  }
  </code></pre>