How to insert values into table after adding a new column to a table?
622404Mar 25 2008 — edited Mar 25 2008Hello everyone,
Does anyone know what the sql statement is to insert values into a new column when the table has just been added with a new column? I have a table called "copy" and have several existing columns already. Thereafter, I've added a new column called "times" into this table using: alter table add times varchar(3)".
Now this column is empty and I want to insert values into this column based on a criteria, that is whichever rows that have a "shelfmark number" I want would have the value inserted. That is, if shelfmark 03-370 is in a row in the database, i hope to add a value to this row's times column:
insert into copy(times) values("3") where shelfmark='03-370';
But this is not possible because this is a wrong SQL. Does anyone have an idea what should my SQL look like? Any suggestion is welcomed.
Best regards,
Daniel