1) Internal connectionSelect a.*,b.* from a inner join B on a.id=b.parent_idThe result is1 Sheets 3 1 23 12 Lee 42 34 22) Left connectionSelect a.*,b.* from a LEFT join B on a.id=b.parent_idThe result is1 Sheets 3 1 23 12 Lee 42 34 23 Wang Wu Null3) Right connectionSelect a.*,b.* from a right
The right Outer join operator returns each row of the join that satisfies the second (bottom) input for each matching row entered with the first (top) input. In addition, it returns any row in the second input that does not have a matching row in the first input, that is, a NULL jo
Left join: to the Left; Right connection: to the right
The first part, the connection inquiry
One, inner connection
The INNER JOIN query operation lists the rows of data that match the join criteria, which compares the column values of the connected columns using comparison
Four Oracle connections: left outer connection, right outer connection, inner connection, and full connection. Right outer connection of oracle
Today, when looking at a data table of a legacy system, we found that the view we usually look for is full out
First, the concept
1. Left join the left outer join
To the left table, go to the right table to find the same field, if more than one will be listed in sequence
2. Connect Join
Find the same records around the same
3. Fully connected full
query from statement 7 and statement 8 are clearly different, and the result of statement 8 is incomprehensible. Therefore, it is recommended that when writing a connection query, on the following is only a join condition, while the conditions for the intermediate table restrictions are written to the WHERE clause. Statement 9: All outer joins (full OUTER
,c.nameFrom ORDERS O left OUTER joins CUSTOMERS C on c.id=o.customer_id and o.order_numberThe Results from statement 7 and statement 8 queries are clearly different, and the results shown in statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the join condition, and the conditions for the intermediate table restrictions are writ
,o.customer_id,c.id,c.nameFrom ORDERS O left OUTER joins CUSTOMERS C on c.id=o.customer_id and o.order_number The Results from statement 7 and statement 8 queries are clearly different, and the results shown in statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the join condition, and the conditions for the intermediate table r
Statement 8: Place the WHERE condition in statement 7 behind on.SELECT O.id,o.order_number,o.customer_id,c.id,c.nameFrom ORDERS O left OUTER joins CUSTOMERS C on c.id=o.customer_id and o.order_number The Results from statement 7 and statement 8 queries are clearly different, and the results shown in statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the
and statement 8 queries are clearly different, and the results shown in statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the join condition, and the conditions for the intermediate table restrictions are written in the WHERE clause. Statement 9: Full outer join (
different, and the results shown in statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the join condition, and the conditions for the intermediate table restrictions are written in the WHERE clause. Statement 9: Full outer join (OUTER
o.order_number The Results from statement 7 and statement 8 queries are clearly different, and the results shown in statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the join condition, and the conditions for the intermediate table restrictions are written in the WHERE clause. Statement 9: Full outer
written in the WHERE clause. Statement 9: Full outer join (OUTER join). SELECT o.id,o.order_number,o.customer_id,c.id,c.name from ORDERS O OUTER joins CUSTOMERS C on C.id=o.custome r_id; Note: MySQL does not support all-out connections, and the notation given here is for
in statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the join condition, and the conditions for the intermediate table restrictions are written in the WHERE clause. Statement 9: Full outer join (OUTER
statement 8 are difficult to understand. Therefore, it is recommended that when writing a connection query, on is followed only by the join condition, and the conditions for the intermediate table restrictions are written in the WHERE clause. Statement 9: Full outer join (OUTER
FROM emp e right outer join dept d ON (e. deptno = d. deptno); -- RIGHT OUTER JOINSELECT e. ename, d. dname FROM emp e full outer join dept d ON (e. deptno = d. deptno); -- all externa
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.