If you mean set all values to null in the column, then use update:
update mytable set b_color = null;
Disclaimer: original values are deleted for good. You might want to take a backup first.
If you mean permanently remove that column from the table, then use drop column:
alter table mytable drop column b_color;
Use the latter with caution! This is a data definition statement: once the column is gone, it cannot be retrieved any more – you need to recreate it from scratch.
2
Answers
I depends on what you mean by delete a column.
If you mean set all values to
null
in the column, then useupdate
:Disclaimer: original values are deleted for good. You might want to take a backup first.
If you mean permanently remove that column from the table, then use
drop column
:Use the latter with caution! This is a data definition statement: once the column is gone, it cannot be retrieved any more – you need to recreate it from scratch.
You can use an
alter table
statement: