0

I'm trying to prepare an android app.

I have an column in SQLite Database with type as integer.

For Example the value of the integer in Database is 10. Now i want to update the value of that integer to by adding another value i have say 5.

So finally i want to update the integer value in Database to 15.

Which is the better solution to update the integer value in Database among below options

i) Get the Integer value from Database say 10, then add the value i have say 5 and update that integer value in Database.

ii) Is there any way to add value i have say 5 directly to integer value in Database say 10

Thank You in advance

1 Answer 1

2

Try something like this:

UPDATE table SET value = value + 5 WHERE id = 1;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.