I have a database created with table name “Accounts” There are THREE columns. One is named as userId and other is named as accountType. The third account is of accountId The function i want to create is
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
}
I want to retrieve the accountId for the specific accountType and userId i have defined. Please tell the correct formate of query used.
You can use the SQL like below: