I am not very proficient in MySQL: My questions is I have two tables: t1 and t2
t1
Name, ID
t2
ID, types
I want to merge both t1 and t2 only columns containing the ID's and identify why I have the difference in these ID's.
You can investigate the mysql function MERGE
An other alternative would be to add the column types in t1 and update it to add missing data. I assume here your types type is VARCHAR(60):
ALTER TABLE table ADD [COLUMN] types VARCHAR(60);
UPDATE t1,t2 SET t1.types=t2.types WHERE t1.ID=t2.ID;
DROP TABLE t2;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.