sql - Update MySQL by deltas - Rails -


i read can use this:

somemodel.update_all name: 'my name' 

to make batch transaction. possible make change using actual value in each row?

example:

some_models name 'asd' 'qwe' 

a code allows me get:

some_models name 'asd another' 'qwe another' 

?

you need @ database level.. here's how in postgresql

update table_name set column_name = column_name || 'yo'; 

and in mysql(not tested)

update table_name set column_name = concat(column_name ,'yo'); 

Comments