Tuesday, July 4, 2023

mysql plus/add all data in column

 it's effortless if you know it.


UPDATE table_name SET column_name = column_name + 1 WHERE condition;

UPDATE users SET login_count = login_count + 1 WHERE id = 1;


can use with cancat

example : 

UPDATE users SET book = concat(book," add") WHERE id = 1;