本文介绍了MySQL删除多列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试删除多列,但遇到了一些麻烦.当我用括号()中的多个值进行ALTER TABLE和ADD时,以下语法有效,但对于DROP COLUMN则不起作用.我使用的语法错误吗?
I'm trying to drop multiple columns, but having some trouble. The syntax below works when I do ALTER TABLE and ADD with multiple values in the brackets () but it doesn't work with DROP COLUMN. Am I using the wrong syntax?
$table3 = " ALTER TABLE $table3_name DROP COLUMN ( user_firstname, user_lastname, user_address, user_address2, user_city, user_state, user_zip, user_phone ); ";推荐答案
ALTER TABLE `tablename` DROP `column1`, DROP `column2`, DROP `column3`;
更多推荐
MySQL删除多列
发布评论