woninana
woninana

Reputation: 3481

How to add another field in an existing table in mysql

Okay, I have these table table1

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.

Upvotes: 6

Views: 30854

Answers (2)

Sourav
Sourav

Reputation: 17530

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

Upvotes: 1

Tomasz Kowalczyk
Tomasz Kowalczyk

Reputation: 10467

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.

Upvotes: 26

Related Questions