How to add a column to the table:
create table table1 (id integer primary key, field1 text)
? The column would be field2 text
and the value for existing rows in this column should be value
.
How to add a column to the table:
create table table1 (id integer primary key, field1 text)
? The column would be field2 text
and the value for existing rows in this column should be value
.
That would be the SQL syntax:
ALTER TABLE table_name ADD column_name datatype
In your case, you'd be looking at:
alter table table1 add field2 text
update table1 set field2 = 'value'
For MySQL:
ALTER TABLE table1 ADD field2 text;
UPDATE table1 SET field2='value';