I am creating an android application using an SQL database with multiple tables. I need to select rows randomly from some or all the tables (there are around 8).
I have tried the following query, but it is giving me an “IndexOutOfBoundsException” in Java, the query is only selecting data from the “core” table and ignoring the “parking” table. Where have I gone wrong? I have read about the JOIN function, does it apply here?
c = myDataBase.rawQuery(
"SELECT * FROM core, parking" + " ORDER BY RANDOM() LIMIT " + rounds, null);
All tables use the same column structure, but the Column ID overlaps for each one (e.g. for 8 tables, there are 8 “1” column IDs) .The Column IDs are not used in the application.
there must be a column which exist in both table ie ID..
then write as