There are two tables in the database. The first table contains 3 columns:
| ID | ItemTitle | ItemContent |
The second table has 2 columns:
| ID | Favorite |
I need to display the data of the first table by indexes of the Favorite second table, where the Favorite is of the NUMERIC type.
Cursor cursor = sqLiteDatabase.query(MainItemTable.mainItemTable, MainItemTable.columnsMainItem, // тут нужно обратиться к индексу Favorite другой таблицы // например, пытался сделать так: FavoriteTable.favorite + " = 1", null, null, null, null); Is it possible? I suppose that even if I may need to do rawQuery ?
SELECT ItemTitle, ItemContent FROM TableContent, TableFavorite WHERE TableFavorite.ID = TableContent.ID. to broaden horizons, you can (and should) read about communications in SQL — one to many, many to many. The second thought is absolutely wrong :) - pavlofff