mysql 之full join

首先,mysql中是不支持full join的,如果要实现类似的功能可以用union all,union会剔除重复。以下是实现实例

create table if not exists t1(`id` int(10) not null auto_increment,`name` varchar(20),primary key(`id`))ENGINE=MYISAM;


create table if not exists t2(`id` int(10) not null auto_increment,`name` varchar(20),primary key(`id`))ENGINE=MYISAM;

  

insert into t1(`name`)values('zhangsan'),('lisi'),('wangwu'),('zhaoliu'),('dengqi');
insert into t2(`name`)values ('zhaosi'),('wangwu'),('liliu'),('dengqi');

  

 

 

 

posted @ 2017-06-23 16:52  雨落知音  阅读(1357)  评论(0编辑  收藏  举报