Cursor findNormalItems = db.query("items", columns, "type=?",
new String[] { "onSale" });
I want to return the cursor that points anything that are NOT onSale, what should I change? Thanks!
Cursor findNormalItems = db.query("items", columns, "type=?",
new String[] { "onSale" });
I want to return the cursor that points anything that are NOT onSale, what should I change? Thanks!
From the official documentation:
The non-equals operator can be either
!=
or<>
So your code becomes:
Cursor findNormalItems = db.query("items", columns, "type != ?",
new String[] { "onSale" });
You can use <>
operator
You will find here all the basic sql
statements
With rawQuery :
quranCursor = db.rawQuery("SELECT * from alquran WHERE sura_id = '" + sooraId + "' AND ayat_id !='" + "0" + "'", null);
Usage:
int sooraId = 3 ;
try {
// start from not 0, but 1 ; Include All row but ayat_id = 0 :
quranCursor = db.rawQuery("SELECT * from alquran WHERE sura_id = '" + sooraId + "' AND ayat_id !='" + "0" + "'", null);
} catch (Exception e) {
e.printStackTrace();
}
This is tested one of my app, and works fine, Alhamdulillah.