Search code examples
mysqlalter-table

How to add a new field and set all values = '1' in MySQL?


I want add a new field in my database, and set all rows values = '1'.

How to do it correctly?

ALTER TABLE `cxt_20110105` ADD COLUMN tbn INT(1) SET tbn = '1'

Solution

  • Concering the docu:

    ALTER TABLE cxt_20110105 ADD COLUMN tbn INT(1) DEFAULT '1'