ID ORG NUM 1 a 1 2 b 2 3 c 1 ID NAME 1 d 2 e 3 f ID ORG NUM 1 a 1 1 d 2 e 2 b 1 3 f 3 c 1 对照这三张表,你要把第二张表的NAME改变为,ORG,并加一个字段NUM. 两张表的结构一样后才能合并,如果你的是MYISAM表,那好办,就合并成MERGE 表. 合并方法如下: 假设你创建了两张表 create table table1(id int,org int,num int); create table table2(id int,org int,num int); 合并表 create table table1_2(id int,org int,num int) type=merge nuion=(table1,table2); 用select * from table1_2;就可以看到两张表的记录了.
1 a 1
2 b 2
3 c 1
ID NAME
1 d
2 e
3 f
ID ORG NUM
1 a 1
1 d
2 e
2 b 1
3 f
3 c 1
对照这三张表,你要把第二张表的NAME改变为,ORG,并加一个字段NUM.
两张表的结构一样后才能合并,如果你的是MYISAM表,那好办,就合并成MERGE
表.
合并方法如下:
假设你创建了两张表
create table table1(id int,org int,num int);
create table table2(id int,org int,num int);
合并表
create table table1_2(id int,org int,num int) type=merge nuion=(table1,table2);
用select * from table1_2;就可以看到两张表的记录了.