I am new in Android Application Development
I use the UNION query like that
public Cursor getAll() {
return (getReadableDatabase()
.rawQuery(
"SELECT _id,x,y from Not where _id="
+ id
+ " UNION ALL " + "SELECT _id,z,q from Q_A where z="
+ zid, null));
}
public String getX(Cursor c) {
return (c.getString(1));
}
public String getY(Cursor c) {
return (c.getString(2));
}
public String getQ(Cursor c) {
return (c.getString(3));
}
it will give the error
IllegalStateException: get field slot from row 0 col 3 failed
I am totally Stuck on this and get confused whether my query is wrong or my accessing methods is wrong ?
You are going in the wrong way.
This is a simple solution with the join query by two tables