SQLiteException: near "" :syntax error (code 1) while compiling SQLiteException: near "" :syntax error (code 1) while compiling sqlite sqlite

SQLiteException: near "" :syntax error (code 1) while compiling


try below code:-

String selectQuery = "SELECT _id, type, alcohol FROM " + TABLE_BEERS + " WHERE company= ' " + compania+" ' ";

you miss single quotes ..


Text column values must pass in single quotes. Try following

String selectQuery = "SELECT _id, type, alcohol FROM " + TABLE_BEERS + " WHERE company= '" + compania +"'";