1、在tableA与tableB中查询tableA中全部数据和tableB中在tableA中的数据
select * from tableA A left join tableB B on A.key=B.key
2、在tableA中查询排除tableB中数据,剩余的tableA中的数据
select * from tableA A left join tableB B on A.key=B.key where B.key is null
3、查询tableA与tableB中所有的数据
select * from tableA A full outer join tableB B on A.key=B.key
4、查询tableA与tableB两表之外的数据
select * from tableA A full outer join tableB B on A.key=B.key where A.key is null or B.key is null
5、查询tableA与tableB*同的数据
select * from tableA A inner join tableB B on A.key=B.key
相关文章
- 01-19SQL 中 left join、right join、inner join 的区别
- 01-19sql语法:inner join on, left join on, right join on具体用法
- 01-19SQL内连接-外连接join,left join,right join,full join
- 01-19sql语法:inner join on, left join on, right join on具体用法
- 01-19sql语法:inner join on, left join on, right join on具体用法
- 01-19SQL Left、Right Join等操作符总结
- 01-19sql语法:inner join on, left join on, right join on具体用法
- 01-19sql语法:inner join on, left join on, right join on详细使用方法
- 01-19sql的left join 、right join 、inner join之间的区别
- 01-19sql语法:inner join on, left join on, right join on具体用法