Finally, we cannot delete all columns from the table using the ALTER TABLE command with the DROP keyword. In this case, MySQL will return an error message. Demonstrate with the help of the following example
Suppose in the table "Employee" we have two columns "name" and "id", now if we delete these two columns using ALTER TABLE, then MySQL will return the error as follows
mysql> ALTER TABLE employee drop column name, drop column id; ERROR 1090 (42000): You can't delete all columns with ALTER TABLE; use DROP TABLE instead
The above is the detailed content of What does MySQL return when we delete all columns from a table using ALTER TABLE command with DROP keyword?. For more information, please follow other related articles on the PHP Chinese website!