mysql合并两个表为一个表 两个表字段不一样但是数据是关联的 要怎么合并 50
表结构大概是这样:T1:+---------------------+----------+|ID|name|phome|home+-------------------...
表结构大概是这样:
T1: +---------------------+----------+
|ID | name | phome | home
+---------------------+----------+
|1 | 张三 | 131********* | no.1
|2 | 李四 | 158********* | no.2
+---------------------+----------+
T2: +---------------------+----------+
|ID | shop | Howells |
+---------------------+----------+
|1 | iphome 7 plus | Apple |
|2 | ipad mini | Apple |
+---------------------+----------+
然后合并之后是:
+---------------------+----------+
|ID | shop | Howells | name | phome | home
+---------------------+----------+
|1 | iphome 7 plus | Apple | | 张三 | 131********* | no.1
|2 | ipad mini | Apple | | 李四 | 158********* | no.2
+---------------------+----------+ 展开
T1: +---------------------+----------+
|ID | name | phome | home
+---------------------+----------+
|1 | 张三 | 131********* | no.1
|2 | 李四 | 158********* | no.2
+---------------------+----------+
T2: +---------------------+----------+
|ID | shop | Howells |
+---------------------+----------+
|1 | iphome 7 plus | Apple |
|2 | ipad mini | Apple |
+---------------------+----------+
然后合并之后是:
+---------------------+----------+
|ID | shop | Howells | name | phome | home
+---------------------+----------+
|1 | iphome 7 plus | Apple | | 张三 | 131********* | no.1
|2 | ipad mini | Apple | | 李四 | 158********* | no.2
+---------------------+----------+ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询