Is there a way to add a new column and set its default value in MySQL? When I run this command I get a syntax error:
ALTER TABLE tableName ADD newColumn varchar(20) SET DEFAULT 'test';
The documentation I've found doesn't really help me.
Is there a way to add a new column and set its default value in MySQL? When I run this command I get a syntax error:
ALTER TABLE tableName ADD newColumn varchar(20) SET DEFAULT 'test';
The documentation I've found doesn't really help me.
The SET
shouldn't be necessary:
ALTER TABLE tableName ADD newColumn varchar(20) DEFAULT 'test';