We have a column that is a simple integer. We want to add to each row the value 10. How do we do it in sql for the MySQL database?
Actually we have another column th
Integers:
UPDATE table_name SET int_column_value = int_column_value + 10;
UPDATE table_name SET int_column_value = 10 WHERE int_column_value IS NULL;
Dates:
UPDATE table_name SET date_column_value = DATEADD(date_column_value, INTERVAL 1 MONTH);
More info: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_affffdate
update table_name set column_name=column_name+10 where column_name is not null;
UPDATE table_name SET column_value = column_value + 10;
Should be something simple like this:
UPDATE some_table SET int_field = int_field + 10