• notice
  • Congratulations on the launch of the Sought Tech site

How to delete a column in a database table in Mysql

Table of contents
  • delete a column in a database table

  • Mysql delete column, add column sql statement

delete a column in a database table

delete the value of a field

update table_name SET field_name = '' ;

delete a column

ALTER TABLE table_name DROP COLUMN field_name ;

Mysql delete column, add column sql statement

There is a table actor with the column last_name

-- delete the column, the following two ways can be  
alter table actor drop column last_name ;
alter table actor drop last_name ;
--Add a column, the type of the column must be specified 
alter table actor add last_name varchar ( 10 );

The above is a personal experience, I hope it can give you a reference, and I hope you will support us a lot.


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+