我有一个用表名“Accounts”创建的数据库有三列。一个被命名为userId
,另一个被命名为accountType
。第三个帐户是accountId
我想创建功能是从Sqlite查询数据库获取项目
private int getNextAccountIdForUserId (String ourUserId, int ourAccountType)
{
int nextId = kFirstIDValue;
Cursor mCursor = mDb.query(true, ACCOUNT_TABLE, new String[] {"userId", accountType},"accountId", null, null, null, null, null);
...
//what more to do to get the accountId of ourUserId and ourAccountType
}
我想检索我已经定义的特定ACCOUNTTYPE和用户id的帐户ID。请告诉正确的所用查询的合成者。