Home  >  Article  >  Database  >  What is the usage of using in oracle

What is the usage of using in oracle

WBOY
WBOYOriginal
2022-03-02 14:02:516651browse

In Oracle, using is used to simplify join queries. The using keyword can be used to simplify only when the query is an equal value join and the columns in the join must have the same name and data type.

What is the usage of using in oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

What is the usage of using in oracle

Using rules of using keyword in oracle:

1. The query must be an equijoin.

2. The columns in the equijoin must have the same name and data type.

When using the using keyword to simplify the connection, you need to pay attention to the following points:

1. When using the fields in the table1 table and table2 table to connect, in the using clause and select clause , you cannot specify a table name or table alias for a field column.

2. If you use the same multiple columns in the two tables when connecting the query, you can specify multiple column names in the using clause, in the following form:

select... from table1 inner join table2  using(column1,column2);

Above The statement is equivalent to the following statement:

select... from table1 inner join table2 on table1.column1=table2.column2 and table1.column2=table2.column2;

If multiple tables are retrieved, you must use the using keyword multiple times to specify, in the following form:

select... from table1  inner join table2 using(column1)  inner join table3 using(column2);

The above statement is equivalent to the following Statement:

select... from table1,table2,table3  
where table1.column1=table2.column1
and table2.column2=table3.table2;

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of What is the usage of using in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn