Android sqlite INNER JOIN that returns an array

1

I'm using sqlite for android and I want a function that returns an array with all the objects that meet a condition. Let me explain:

I have two tables: Movies

private static final String CREATE_PELICULAS_TABLE =
        "CREATE TABLE " + PELICULAS_TABLE + " (" +
                KEY_PELICULA_ID + " LONG PRIMARY KEY, "
                + KEY_PELICULA_PORTADA + " BLOB NOT NULL, "
                + KEY_PELICULA_DIRECTOR + "TEXT NOT NULL"
                + ")";

Earrings

private static final String CREATE_PENDIENTES_TABLE =
        "CREATE TABLE " + PENDIENTES_TABLE + " (" +
                KEY_PENDIENTES_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                + KEY_PEN_IDSerieOPeli + " LONG NOT NULL );";

In the pending table are the IDs of the movies that have been added as pending. I want a function that through an inner join returns an array with all the movies whose ID is in slopes.

What is the query, I imagine it would be something like this:

private final String QUERY= "SELECT * FROM PELICULAS_TABLE a INNER JOIN PENDIENTES_TABLE b WHERE a.KEY_PELICULA_ID=b.KEY_PEN_IDSerieOPeli";

I guess I should also use rawQuery, but I'm not clear about it.

But I do not quite understand how to make a function that returns all the found films through an array.

    
asked by MarcusF 27.09.2018 в 17:23
source

0 answers