I’m using the Notepad example for my class definition of a DBAdapter.
An example of my table structure:
Vehicle -> "_id", "registration", "idmake", "model"
Make -> "_id", "name"
At the moment I’m using a query to get the vehicle data and fill a ListView:
public Cursor fetchVehicles() {
return mDb.query("Vehicle", new String[] { "_id", "registration",
"idmake", "model" }, null, null, null, null, null);
}
My question is, how can I make a query like this except it returns the corresponding Make name instead of the idmake field?
Thanks
You should
JOINthese two tables.Second param in
rawQuerymethod takeswhere argsso you can do that like this:A little a few about rawQuery method
Regards