I want to add a column to preexisting table. Can I add it in between two existing columns? I am working on phpmyadmin.
我想在预先存在的表中添加一列。我可以在两个现有列之间添加它吗?我正在研究phpmyadmin。
6 个解决方案
#1
20
Use the add new column after dropdown.
下拉列表后使用添加新列。
-
Select the database from the menu on the left.
从左侧菜单中选择数据库。
-
Select the table by clicking on it's title column hyperlink.
通过单击其标题列超链接选择表。
-
Check the add new column after radio button and select the column you want to insert after in the drop down.
选中单选按钮后添加新列,然后在下拉列表中选择要插入的列。
-
Click Add.
单击添加。
This video goes through the process http://www.youtube.com/watch?v=jZ72GCGWPQg
该视频介绍了http://www.youtube.com/watch?v=jZ72GCGWPQg
#2
3
You want something like:
你想要的东西:
ALTER TABLE contacts ADD email VARCHAR(60);
#3
2
The ordering of columns in MySQL isn't of much importance. As for adding a new column,
MySQL中列的排序并不重要。至于添加新列,
ALTER TABLE `tblName`
ADD COLUMN `colName` INT(10) AFTER `firstCol`;
The AFTER
clause defines the position where your new column will come.
AFTER子句定义新列的位置。
#4
2
I think this video can help you. With PHPMyAdmin
我认为这个视频可以帮到你。使用PHPMyAdmin
- Go to the page of the table you want to modify
- 转到要修改的表的页面
- At the bottom of the page, select you desired column in "After" (at which position you want to add your column in the table)
- 在页面底部,在“之后”(您要在表格中添加列的位置)中选择所需的列
- Validate and enter new column information
- 验证并输入新的列信息
You can also do it via plain SQL, with a ALTER TABLE
query:
您也可以使用ALTER TABLE查询通过纯SQL执行此操作:
ALTER TABLE mytable ADD column3 INT AFTER column1
#5
2
Yes, you can do that. See a "after" list box in the section. you can select after which field your new field need to be added.
是的,你可以这么做。请参阅本节中的“后”列表框。您可以选择在需要添加新字段的字段之后。
#6
#1
20
Use the add new column after dropdown.
下拉列表后使用添加新列。
-
Select the database from the menu on the left.
从左侧菜单中选择数据库。
-
Select the table by clicking on it's title column hyperlink.
通过单击其标题列超链接选择表。
-
Check the add new column after radio button and select the column you want to insert after in the drop down.
选中单选按钮后添加新列,然后在下拉列表中选择要插入的列。
-
Click Add.
单击添加。
This video goes through the process http://www.youtube.com/watch?v=jZ72GCGWPQg
该视频介绍了http://www.youtube.com/watch?v=jZ72GCGWPQg
#2
3
You want something like:
你想要的东西:
ALTER TABLE contacts ADD email VARCHAR(60);
#3
2
The ordering of columns in MySQL isn't of much importance. As for adding a new column,
MySQL中列的排序并不重要。至于添加新列,
ALTER TABLE `tblName`
ADD COLUMN `colName` INT(10) AFTER `firstCol`;
The AFTER
clause defines the position where your new column will come.
AFTER子句定义新列的位置。
#4
2
I think this video can help you. With PHPMyAdmin
我认为这个视频可以帮到你。使用PHPMyAdmin
- Go to the page of the table you want to modify
- 转到要修改的表的页面
- At the bottom of the page, select you desired column in "After" (at which position you want to add your column in the table)
- 在页面底部,在“之后”(您要在表格中添加列的位置)中选择所需的列
- Validate and enter new column information
- 验证并输入新的列信息
You can also do it via plain SQL, with a ALTER TABLE
query:
您也可以使用ALTER TABLE查询通过纯SQL执行此操作:
ALTER TABLE mytable ADD column3 INT AFTER column1
#5
2
Yes, you can do that. See a "after" list box in the section. you can select after which field your new field need to be added.
是的,你可以这么做。请参阅本节中的“后”列表框。您可以选择在需要添加新字段的字段之后。