thelolcat
thelolcat

Reputation: 11545

Can I update a records value using an addition?

How can I add a number to an INTEGER column?

Like UPDATE tbl SET col +? WHERE id = ?

where the first ? is the number which I want to add

Is it possible?

Upvotes: 1

Views: 33

Answers (1)

Robert
Robert

Reputation: 25753

Try this way:

UPDATE tbl 
SET col =col+1 
WHERE id = ?

Upvotes: 2

Related Questions