I want to consult a SQLite database in Android Studio. Having a database of people, which has the fields age and name. What I want is to extract from the database all people who are 19 years old.
SQLiteDatabase db = OpenHelper.getReadableDatabase();
String buscar[] ={"19"};
String campos[] = {Utilidad.CAMPO_NOMBRE};
Cursor cursor = db.query("personas",campos,Utilidad.CAMPO_EDAD+"=?",buscar,null,null,null);
In the previous code you see what I programmed at first, but I understand that the first person I find at 19 is stored in the cursor, but if I wanted to store all the people who can appear at 19 years of age should do?
Thank you very much