I would like to my query to the database look like this:
UPDATE table_name SET salary = salary + cash WHERE id_wallet = id_wallet2
cash and id_wallet2- transmitted by method
I wrote this method. But the method changes the salary, do not bear the extra money. Do you have any ideas how to do it?
public void AddCashWallet(int id_wallet, double cash){
ContentValues contentValues1 = new ContentValues();
ContentValues contentValues2 = new ContentValues();
contentValues2.put(Wallets.COLUMNS.id_walllet, id_wallet);
contentValues1.put(Wallets.COLUMNS.currency_cash,cash);
DbHelper.getWritableDatabase().update(Wallets.TABLE_NAME,contentValues1,""+contentValues2,null);
}
But I want my query look like this: UPDATE table_name SET salary = salary + cash WHERE id_wallet = id_wallet2
In this moment look like: UPDATE table_name SET salary = cash WHERE id_wallet = id_wallet2