我试图从Android应用程序中的sql lite数据库中复制一条记录,然后将同一条记录插入到同一个表中,但前两列中有两个不同的ID。有任何想法吗?
SQLiteDatabase db = dbs.getReadableDatabase();
String SQL = "SELECT * FROM table_1 a " +
"join table_2 b on a.ID = b.ID " +
"where table1_Id = '"+Id+"' And" +
"table_2_ID = 'one'";
Cursor cursor2 = db.rawQuery(SQL, null);
startManagingCursor(cursor2);
int m = cursor2.getColumnCount();
try{
while (cursor2.moveToNext()) {
for(int i=0; i<m; i++){
String id1 = cursor2.getString(i);
}
}
}
catch(Exception e){}
答案 0 :(得分:0)
try {
while (cursor2.moveToNext()) {
dbs.ad(Id, Id, cursor2.getString(3), "",
cursor2.getString(5), cursor2.getString(6), cursor2.getString(7),
"", "");
}
}