Home > database >  MySQL to merge the two pieces of the same field information form
MySQL to merge the two pieces of the same field information form

Time:10-11

Merge the two form, the following
A table:
Field information: ID, IOSIDFA, DID, IOSAD, TIME
Table B:
Field information: ID, AndroidIDFA, DID, IOSAD, TIME
Want to merge into table C
Format is as follows:
Field information: ID, IDFA, DID, AD, TIME
IDFA IOSIDFA and AndroidIDFA
AD contains IOSAD and IOSAD

What is shown in figure:

CodePudding user response:

Select * from A
Union all
Select * from B

CodePudding user response:


 insert into CSelect ID, IOSIDFA, DID IOSAD, TIME from A table 
Union all
Select ID, AndroidIDFA, DID IOSAD, TIME from table B

CodePudding user response:

Insert into C
Select ID, IOSIDFA, DID IOSAD, TIME from A table
Union all
Select ID, AndroidIDFA, DID IOSAD, TIME from table B

CodePudding user response:

refer to the second floor ACMAIN_CHM response:
 
insert into CSelect ID, IOSIDFA, DID IOSAD, TIME from A table
Union all
Select ID, AndroidIDFA, DID IOSAD, TIME from table B


Bosses, seems to be wrong, because C table has not yet been built, to build a C list first, and then inserted into the data, the zha do

CodePudding user response:


 insert into CSelect ID, IOSIDFA, DID IOSAD, TIME from A table 
Union all
Select ID, AndroidIDFA, DID IOSAD, TIME from table B
  • Related