So I am trying to select the count where a value = value* conditional to another boolean value being true. I wrote a query as such I am new to sqlite so I am sorry in advance for syntax:
public int getPlaceCount(String name){
SQLiteDatabase db = this.getWritableDatabase();
String query = "SELECT COUNT(*) FROM " + TABLE + " WHERE " + NAME + " = ? AND " + CURRENT + " <> ?";
String value = "0";
Cursor cursor = db.rawQuery(query,new String[]{name,value});
int count = cursor.getInt(cursor.getColumnIndex("COUNT(*)"));
return count;
}
now in mysql I would do something like this:
select count(*) from TABLE where NAME='name' and CURRENT=1;
thanks in advance