0
int mWordId = 65535;
String[] projection = {
"wordId",
"rank",
};
String selection = "wordId MATCH ? ";
String[] selectionArgs = {Integer.toString(mWordId)};
Cursor c = pDatabase.query("words"
,projection
,selection
,selectionArgs
,null
,null
,"rank DESC");
c.moveToFirst();
int count= c.getCount();
2.
int mWordId = 65535;
String[] projection = {
"wordId",
"rank",
};
String selection = "wordId =? ";
String[] selectionArgs = {Integer.toString(mWordId)};
Cursor c = pDatabase.query("words"
,projection
,selection
,selectionArgs
,null
,null
,"rank DESC");
c.moveToFirst();
int count= c.getCount();
3.
String query = "SELECT wordId,rank From words WHERE wordId=65535 ORDER BY rank DESC";
Cursor c = pDatabase.rawQuery(query,null);
c.moveToFirst();
int count= c.getCount();
1,我使用 「匹配」 的數目和結果爲1.
2,我使用「=」和結果數爲0.
在3中,我使用「=」和rawQuery()。結果的數量是1.
我找不到問題。