Collections:
Delete an Existing Column in a Table in MySQL
How To Delete an Existing Column in a Table in MySQL?
✍: FYIcenter.com
If you have an existing column in a table and you do not need that column any more, you can delete it with "ALTER TABLE ... DROP COLUMN" statement. Here is a tutorial script to delete an existing column:
mysql> ALTER TABLE tip DROP COLUMN create_date; Query OK, 1 row affected (0.48 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM tip; +----+-------------+-------------------------+--------+ | id | subject | description | author | +----+-------------+-------------------------+--------+ | 1 | Learn MySQL | Visit dev.fyicenter.com | NULL | +----+-------------+-------------------------+--------+ 1 row in set (0.00 sec)
As you can see the column "create_date" is gone.
⇒ Rename an Existing Column in a Table in MySQL
⇐ Add a New Column to an Existing Table in MySQL
2018-03-04, 2051🔥, 0💬
Popular Posts:
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can u...
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
What Is ISAM in MySQL? ISAM (Indexed Sequential Access Method) was developed by IBM to store and ret...
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
How To Look at the Current SQL*Plus System Settings in Oracle? If you want to see the current values...