oracle 中 inner join内连接、 left join左连接、right join右连接用法
来源:互联网 发布:comsol正规软件多少钱 编辑:程序博客网 时间:2024/05/17 04:25
1. inner join内连接 语法:
select A.*, B.* from A inner join B on A.id = B.id
2. left join 左连接 语法:
select table1.column,table2.column
from table1 left join table2 on table1.column1 = table2.column2;
3.right join右连接 语法:
select table1.column,table2.column
from table1 right join table2 on table1.column1 = table2.column2;
inner join 表示内连接;
left join表示左外连接;
right join表示右外连接;
full join表示完全外连接;
on子句用于指定连接条件。
注意,如果使用from子句指定内、外连接,则必须要使用on子句指定连接条件;
如果使用(+)操作符指定外连接,则必须使用where子句指定连接条件。
补充:
使用(+)的注意事项:
1.(+)操作符只能出现在where子句中,并且不能与outer join语法同时使用。
2.当使用(+)操作符执行外连接时,如果在where子句中包含有多个条件,则必须在所有条件中都包含(+)操作符。
3.(+)操作符只适用于列,而不能用在表达式上。
4.(+)操作符不能与or和in操作符一起使用。
5.(+)操作符只能用于实现左外连接和右外连接,而不能用于实现完全外连接。
- oracle 中 inner join内连接、 left join左连接、right join右连接用法
- Sql查询左连接(left join),右连接(right join),内连接(inner join)
- 内连接<inner join>,左外连接<left outer join>,右外连接<right outer join>
- mysql左连接left join右连接 right join 内连接 inner join笔记
- 数据库中的左连接(left join),右连接(right join)和内连接(inner join)
- 左连接Left Join,右连接Right Join,内连接Inner Join
- sql之LEFT JOIN(左连接)、RIGHT JOIN(右连接)、INNER JOIN(内连接)
- 数据库表连接之左连接(LEFT JOIN)、右连接(RIGHT JOIN)和内连接(INNER JOIN)
- 简单的sql左连接left join 右连接right join 内连接inner join的示例.
- Oracle中内连接查询(inner join),自然连接查询(natural join),自连接查询,外连接查询(outer join),左外连接(left join),右外连接(right joi
- 等值连接(inner)左连接(left join)和右连接(right join) 自连接
- SQL语句中left join(左外连接)、right join(右外连接)、inner join(内连接)的区别
- left join(左联接)right join(右联接) inner join(等值连接) 区别
- oracle中各种连接(left join,right join,inner join)用法
- 内连接、外连接(左连接、右连接、全外连接)inner join on, left join on, right join on
- 左连接右连接 left join right join
- sql内连接,等值连接,左连接和右连接的使用技巧(inner join and left join and right join)
- Mysql左连接left join on与右连接 right join on,内连接union区别
- 数组和指针并不相同
- 指针和数组一致的情况及二维数组初始化
- getopt、getopt_long的可重入版本----linux交互式应用程序
- 业界盘点:Linux和微软应该相互学习的5件事?
- fcitx的安装使用
- oracle 中 inner join内连接、 left join左连接、right join右连接用法
- wine QQ2008
- 编译ubuntu8.04内核
- lfs的介绍
- c/c++编程风格
- sizeof
- 宏和预处理器
- 搜集一些面试题资料
- const