jeudi 7 mai 2015

OR condition Sqlite

In My application I am setting 3 alarms for one medicine.. I want to get the medicine name for any one of them.. The query I am firing-

String selectQuery = "SELECT " + MedName+" FROM " + TABLE_LABELS +" WHERE "+Alarm1+ "=? OR "+Alarm2+ "=? OR "+Alarm3+ "=?";

This returns the name only for alarm1. The names for alarm2 and alarm3 are empty. What am I missing?

Aucun commentaire:

Enregistrer un commentaire