Page 1 of 1

auto update a table

Posted: Thu Oct 10, 2002 4:59 pm
by abionifade
I have just inserted a new coloumn into an existing mysql table that has been in use for quite a while. I would like to insert the value 'sold' into that coloumn for every record that exists within the table.

is there a mysql line that i can type into the command line that will do this for me?

Thanks!

Posted: Thu Oct 10, 2002 5:31 pm
by rev
update tableName set columnName = 'value';

This will set columnName to value in every record within tableName.

Posted: Thu Oct 10, 2002 5:47 pm
by Coco
add a new collumn with a default value of sold.....