我想做类似于以下的事情:
Cursor mCursor = db.rawQuery("SELECT * FROM Table1, Table2 " +
"WHERE Table1.id = Table2.id_table1 " +
"GROUP BY Table1.data1", null);
是否可以使用存在于两个不同数据库上的表来做同样的事情?
只需先附加另一个数据库:
db.execSQL("ATTACH '/path/to/other.db' AS otherDB");
db.rawQuery("SELECT * FROM Table1, otherDB.Table2 " +
"WHERE Table1.id = otherDB.Table2.id_table1 " +
"GROUP BY Table1.data1", null);