MySQL 如何在mysql的现有表中添加另一个字段

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6260015/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 20:08:59  来源:igfitidea点击:

How to add another field in an existing table in mysql

mysqlphpmyadmin

提问by woninana

Okay, I have these table table1

好的,我有这些桌子 表格1

and I also have another table right here:

我这里还有一张桌子:

enter image description here

在此处输入图片说明

So,idAlbum is in the gallery table, what is the query for this? I want to select the data from one field in one table and insert it into a field in another table.

那么,idAlbum 在gallery 表中,这是什么查询?我想从一个表中的一个字段中选择数据并将其插入到另一个表中的一个字段中。

回答by Tomasz Kowalczyk

If you want to add a field in existing table in PhpMyAdmin, click "Structure" tab while viewing its data, and at the bottom of table structure you have nice box: "Add [number] fields at the [beginning / ending] of a table. Click the button on the right and processd with forms.

如果要在 PhpMyAdmin 中的现有表中添加字段,请在查看其数据时单击“结构”选项卡,在表结构的底部有一个不错的框:“在 [开始/结束]表格。单击右侧的按钮并使用表格进行处理。

回答by Sourav

INSERT INTO tbl_temp2 (fld_id)
 SELECT tbl_temp1.fld_order_id
 FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;