文档地址:http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm#i2080416
subquery::=
Description of the illustrationsubquery.gif
join_clause::=
Description of the illustrationjoin_clause.gif
inner_cross_join_clause::=
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 the illustrationouter_join_clause.gif
---注意上边外连接,有自然连接,但中间需要加上outer_join_type--外连接类型
(table_reference::=,query_partition_clause::=)
Description of the illustrationouter_join_type.gif