In Oracle, "join on" is often used for inner joins and outer joins. If you use from inner or outer joins, you must use the on operator to specify the connection conditions. Join means connecting two tables, and on means this Two tables are joined by some condition.
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
Oracle Join ON usage method:
Inner connection and external link:
Inner connection is used to return satisfaction Records of connection conditions; outer join is an extension of inner join. It will not only return records that meet the connection conditions, but also return records that do not meet the connection conditions. The syntax is as follows:
select table1.column,table2.column from table1 [inner|left|right|full]join table2 on table1.column=table2.column;
inner join means inner join , left join means left outer join, right join means right outer join, full join means full join; on is used to specify the connection conditions.
Join is to connect two tables, and on means that the two tables are connected through certain conditions.
Note: If you use from inner or outer joins, you must use the on operator to specify the connection. Condition; if you use the () operator to connect, you must use where to specify the connection condition.
1. Inner join The inner join query returns all records that meet the conditions. By default, if no connection is specified, it is an inner join. For example:
select t1.name,t2.name from cip_temps t1 inner join cip_tmp t2 on t1.ID=t2.id;
2. Left outer join The left outer join query not only Returns all records that meet the conditions, and also returns other rows in the table on the left side of the connection operator that do not meet the connection conditions, for example:
select t1.name,t2.name from cip_temps t1 left join cip_tmp t2 on t1.ID=t2.id;
3, right outer join The right outer join query not only returns all records that satisfy the price adjustment , and will also return other rows in the table on the right side of the connection operator that do not meet the connection conditions, for example:
select t1.name,t2.name from cip_temps t1 right join cip_tmp t2 on t1.ID=t2.id;
4. Full join The full join query not only returns all records that satisfy the price adjustment, but also returns those that do not satisfy the connection Other lines of conditions, for example:
select t1.name,t2.name from cip_temps t1 full join cip_tmp t2 on t1.ID=t2.id;
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of What is the usage of join on in oracle. For more information, please follow other related articles on the PHP Chinese website!