Mysql to update all +1 values ​​where the value is less than 100

I have a table like this:

create table `test` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `value` smallint (3) NOT NULL, 

I am trying to make a mysql query that increments each row in the test table, where value less than 100.

+4
source share
2 answers
 update test set value=value+1 where value < 100 
+10
source
 update table set value = (value + 1) where column <= 100; 
+1
source

Source: https://habr.com/ru/post/1342746/


All Articles