In MySQL, is there a way to drop every field in my table, short of using:
ALTER TABLE `table`
DROP COLUMN d1,
DROP COLUMN d1,
etc....
Almost like TRUNCATE for fields maybe?
In MySQL, is there a way to drop every field in my table, short of using:
ALTER TABLE `table`
DROP COLUMN d1,
DROP COLUMN d1,
etc....
Almost like TRUNCATE for fields maybe?
You'll get an error when you try to drop the last column:
ERROR 1090 (42000): You can't delete all columns with ALTER TABLE; use DROP TABLE instead
Says it all! There's no way to have a table with zero columns.