php - mysql table field problem
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 13:00:36
0
3
374

I have a question. I have a table A and a table B. Table A is the main table, used to store the main information, and table B is an additional table, used to store secondary information. How can I bring one of the fields of table B into Copy the value in the above field to the main table?

过去多啦不再A梦
过去多啦不再A梦

reply all(3)
迷茫
UPDATE A INNER JOIN B ON A.id = B.id SET A.a = B.b;

A.id = B.id: the associated fields of the two tables;
A.a: the field that receives the data from table B;
B.b: the field that will be copied to table A.

过去多啦不再A梦

First you need to add this field to table A, and then update the joint table
Or you can create a view for them if you need a simple query

过去多啦不再A梦

A relates to B, join table query

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template