1. Oracle Natural join www.2cto.com Java code <span style = "font-size: 12px;"> create table test_table_A (id number primary key, name
Varchar (32); create table test_table_ B (id number primary key, name varchar (32), des varchar (32); select * from test_table_A; select * from test_table_ B; insert into test_table_A (id, name) values (1, 'cuiyaonan20 A'); insert into test_table_A (id, name) values (2, 'cuiyaonan200 '); insert into test_table_A (id, name) values (3, 'cuiyaonan2000 A'); insert into test_table_A (id, name) values (4, 'cuiyaonan2000 @ 163.com '); insert into test_table_ B values (1, 'cuiyaonan20 A', 'des 1'); insert into test_table_ B values (2, 'cuiyaonan200 A', 'des 2 '); insert into test_table_ B values (3, 'cuiyaonan2000 A', 'des 3'); insert into test_table_ B values (4, 'cuiyaonan20 B ', 'des 1 '); insert into test_table_ B values (5, 'cuiyaonan200 B ', 'des 2'); insert into test_table_ B values (6, 'cuiyaonan2000 B', 'des 3 '); </span> run the above instance code www.2cto.com in pl/SQL and then execute: Java code select * from test_table_a natural join test_table_ B; the result is:
This is self-join. If table A and table B have fields of the same name and the field type is the same, the system checks whether the content is equal.
Run the following code: Java code select * from test_table_a join test_table_ B using (name); the result is: www.2cto.com.
Obviously, using sets a column for matching relative to natural (the prerequisite is the same, and the field has the same name,
Type)