How to add another field in an existing table in m

2019-04-08 08:40发布

问题:

Okay, I have these table

and I also have another table right 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.

回答1:

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.



回答2:

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