In my application previously I was retrieving data from table which is in sqlite database. So I was using following way to get the data:
cursor = database.query("CIRCLE", new String[] { "CIRCLE_ID",
"ZONE_ID", "NAME" }, "ZONE_ID = " + id, null, null, null, "NAME");
cursor.moveToFirst();
if (!cursor.isAfterLast()) {
do {
circleLists.add(new CircleList(cursor.getInt(0), cursor
.getInt(1), cursor.getString(2)));
} while (cursor.moveToNext());
}
cursor.close();
Now I need to retrieve data from one table whose id is matched by id of some other table and where condition match id(after getting data) from some other table. I have the SQl query. I don't know how to implement this query in cursor = database.query(...)
The SQL query is:
select d.division_id, d.name from division d, division_circle_assoc dca
where d.division_id = dca.division_id and dca.circle_id = 1