oracle连接叙述

文档地址:http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm#i2080416

 

subquery::=

Description of subquery.gif follows
Description of the illustrationsubquery.gif

 

join_clause::=

Description of join_clause.gif follows
Description of the illustrationjoin_clause.gif

inner_cross_join_clause::=

Description of inner_cross_join_clause.gif follows
Description of the illustrationinner_cross_join_clause.gif


--内连接在ON 后边可以接受条件子句:比如

SELECT i.product_id, i.quantity_on_hand , pi.supplier_id
FROM product_information pi JOIN inventories i
ON (pi.product_id=i.product_id) ANDquantity_on_hand <5;--这语句是可以执行的,并返回期望的结果。

 

--自然连接(也分内连接和外连接,外连接见下,但这语法是内连接的自然连接)JOIN后边跟的是

table_reference--表的引用,后边不能跟条件。比如:

SELECT product_id, quantity_on_hand , supplier_id
FROM product_information
NATURAL JOIN inventories ANDquantity_on_hand <5;--这语句会报错。不符合语法规则。报错:ora-00933:SQL命令未恰当结束。

 

 

(table_reference::=,query_partition_clause::=)

outer_join_clause::=

Description of outer_join_clause.gif follows
Description of the illustrationouter_join_clause.gif
---注意上边外连接,有自然连接,但中间需要加上outer_join_type--外连接类型

(table_reference::=,query_partition_clause::=)

 

outer_join_type::=

Description of outer_join_type.gif follows
Description of the illustrationouter_join_type.gif



 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值