O
O
Optimus2015-12-09 15:57:12
PHP
Optimus, 2015-12-09 15:57:12

Does addition exist in SQL?

In the mysql database cell, there is a value of 10. In php, this is select then +1 then update. It will become 11.
Question: is it possible to add the required value purely on sql, or at least make +1?
Google led only to SUM www.sql.ru/docs/sql/u_sql/ch6.shtml but it adds up all the values ​​in a column, which is not it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2015-12-09
Pyan @marrk2

This is?
UPDATE tablename SET val = val + 1 WHERE .....

R
romy4, 2015-12-09
@romy4

Google did not lead to the manual on mysql?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question