赞
踩
inner join
select * from tableA a inner join tableB b on a.id=b.id;
left join
select * from tableA a left join tableB b on a.id=b.id;
right join
select * from tableA a right join tableB b on a.id=b.id;
select * from tableA a left join tableB b on a.id=b.id where b.id is null;
select * from tableA a right join tableB b on a.id=b.id where a.id is null;
select * from tableA
union
select * from tableB
select * from tableA a right join tableB b on a.id=b.id where a.id is null
union
select * from tableA a left join tableB b on a.id=b.id where b.id is null;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。