Inner JOIN (equivalent connection) returns only rows that have the same join field in two tablesLeft join returns records containing all the records in the left table and the equivalent of the junction fields in the right tableRight join returns records that contain all the
Type DefinitionThe inner connection only connects the matched rows.The left Outer Join contains all rows in the left table (no matter whether the table on the right has rows matching them) and all matched rows in the right tableThe right Outer Join contains all rows in the right table (no matter whether the left table has rows matching them) and all matched rows
Tags: style using os strong data art AR codeInner JOIN (equivalent connection) returns only rows that have the same join field in two tablesLeft join returns records containing all the records in the left table and the equivalent of the junction fields in the right tableRight join returns records that contain all the r
Tags: style color using OS strong data for ARINNER JOIN (equivalent join) returns only rows that have the same join field in two tablesLeft join returns records that include all the records in the left table and the equivalent of the junction fields in the right tableRight join
Tags: style using SP data on BS EF size sqlLeft join returns records that include all the records in the left table and the equivalent of the junction fields in the right table Right join returns records that include all records in the right table and the junction fields in the left table INNER JOIN (equivalent
Tags: example rom search equivalent connection A20 data type log representation TargeOriginal address: http://www.cnblogs.com/pcjim/articles/799302.html The difference between the left join of SQL, right join, INNER join Left join returns records that include all the records
Tags: table cartesian outer data str name OSS PHP altBy default, the inner join, the left join and the right join used in development belong to the outer join, and the outer join also includes the full
Tags: Data SQL SelectThe difference between the left join of SQL, right join, INNER joinLeft join returns records that include all the records in the left table and the equivalent of the junction fields in the right tableRight join returns records that include all records in
Label:The difference between the left join of SQL, right join, INNER joinLeft join returns records that include all the records in the left table and the equivalent of the junction fields in the right tableRight join returns records that include all records in the right tabl
The difference between the left join of SQL, right join, INNER joinLeft join returns records that include all the records in the left table and the equivalent of the junction fields in the right tableRight join returns records that include all records in the right table and
The difference between the left join of SQL, right join, INNER joinLeft join returns records that include all the records in the left table and the equivalent of the junction fields in the right tableRight join returns records that include all records in the right table and
left join is exactly the opposite, this time it is based on the right table (B), where a table is not enough to fill with null. 4. Inner Join Example: 4.1Select * from A inner join B on a.aid = B.bid; This shows only the records of A.aid = B.bid. This shows that
a can be viewed as the left-hand table, B can be viewed as the right table, and left table.
In other words, the records in the left table (A) will all be represented, and the right table (B) will only display records that match the search criteria (in the example: A.aid = b.bid).
b tables where the records are insufficient are null.
2.right join (right join)
The SQL statement is as follows:
SELECT * from
A good memory is better than a bad penThere are three kinds of SQL connection: Inner connection, outer connection, cross connection.Inner connection includes: equivalent connection, non-equivalent connection, natural connectionOuter connection includes: Left join (left outer connection), right connection (right outer connection)Concrete theory, see my blog post http://blog.csdn.net/jdfkldjlkjdl/article/deta
Tags: find php yourself join where difference intersection from HTMTransfer from http://www.phpddt.com/db/inner_join-outer-join.html The difference between inner join, outer join, and Cross join in SQL many people do not know, I also ask, just look for information to look at
SQL statement is as follows:Select * fromRight joing BOn a. Aid = B. Bid
The result is as follows:Aid anum bid bname1 A11 1 B112 A22 2 B223 A33 3 B334 A44 4 b44Null null 8 b88(The number of affected rows is 5)
Result description:After careful observation, we will find that the result of left join is exactly the opposite. This time, it is based on the right table (B) and is filled with null when table A is insufficient.
3.
left join is based on the left table.In other words, the records in the left table (a) are all expressed, while the right table (B) only displays records that meet the search criteria (in this example:. aid = B. bid ).All records in Table B are null.
2. Right join (right join)
The SQL statement is as follows:Select * fromRight joing BOn a. Aid = B. Bid
The resul
records of the left table (A) will all be represented, and the right table (B) will only display records that match the search criteria (in the example: A.aid = b.bid).The low-record of table B is null.--------------------------------------------2.right JoinThe SQL statements are as follows:SELECT * FROM ARight Join BOn a.aid = B.bidThe results are as follows:AID Anum BID bname1 a20050111 1 20060324012 a20050112 2 20060324023 a20050113 3 20060324034
right table, and B can be regarded as left table.In other words, the records of the left table (A) will all be represented, and the right table (B) will only display records that match the search criteria (in the example: A.aid = b.bid).The low-record of table B is null.--------------------------------------------2.right JoinThe SQL statements are as follows:SELECT * FROM ARight Join BOn a.aid = B.bid The results are as follows:AID Anum BID bname1 a2
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.