oracle表连接

oracle表连接
key words: 表连接
内连接

select statement from table1 join table2 on table1.fieled1 = table2.field2

select statement from table1 ,table2 where table1.field1 = table2.field2


左连接

select .....table1 left outer join table2 on table1....= table2.field

select .... table1 ,table2 where table1.field1= table2.field(+)

合并查询
union:获得并集,并自动去掉重复行,并且会以第一列的结果进行排序
union all: 获得并集,但不去掉重复行,也不排序

子查询:
对于多行子查询,必须要用多行运算符(IN,NOT IN,EXISTS,NOT EXISTS,ALL,ANY)

你可能感兴趣的:(oracle表连接)