I am working in an android application and I want to work fetch details in my application local Db. The query that I am using has inner join,so its not returning values.But in the same method if I use with the query without inner join it returns value.
Please help me
public boolean isAvailableTransitionFile(String MenuName) {
String query = "select * from Transition_File_Table inner join item_sync on Transition_File_Table.Menuitem_id=item_sync.id where item_sync.itemName=?";
Cursor cursor = this.db.rawQuery(query,
new String[] { String.valueOf(MenuName) });
Log.e("Count", cursor.getCount() + "");
if (cursor.moveToFirst()) {
return true;
} else {
return false;
}
}
SQL problems are usually due to a wrong syntax utilization in SQL, always test them before you use them in a program. I found a similar post here:
How do I join two SQLite tables in my Android application?
And you should try this code: