mercredi 25 mars 2015

android sqllite select with like

i'm working sqlite.i wrote some code witch can to select some datas with like in table this is a part my source



String[] args = new String[1];
args[0] = "%" + personalid + "%";
Cursor friendLike = db
.rawQuery(
"select * from LoanList WHERE PersonID like ?",
args);


SQLiteDatabase db = this.getWritableDatabase();
//Cursor cursor = db.rawQuery(selectQuery, null);

System.out.println("Cursor Count = " + friendLike.getCount());


i can select with PersonID from loan list,but now i want to select(with like) with two parameters. with PersonID and for example personage just,i want to add second parameter in select how i can solve my problem?


Aucun commentaire:

Enregistrer un commentaire