首页 > 数据库技术 > 详细

SQL Left、Right Join等操作符总结

时间:2014-09-29 10:34:41      阅读:200      评论:0      收藏:0      [点我收藏+]
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

SQL Left、Right Join等操作符总结

原文:http://blog.csdn.net/huanghunjiuba/article/details/39665801

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!