Reproduced in: http://www.2cto.com/database/201206/137067.html Comparison of SQL Server left Join,right join and inner join today to look at the database left join,Right join and INNER join the difference between the three people
Left 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 junction fields in the left tableINNER JOIN (equivalent join) returns only rows that have the same
For example:
Hive> select * From zz0;111111222222888888Hive> select * From zz1;111111333333444444888888
Hive> select * From zz0 join zz1 on zz0.uid = zz1.uid;111111 111111888888 888888Hive> select * From zz0 left Outer Join zz1 on zz0.uid = zz1.uid;111111 111111222222 null888888 888888Hive> select * From zz0 right Outer Join zz1 on zz0.uid = zz1.uid;Null111111
These two days, in the study of SQL syntax in the use of inner JOIN multi-table query syntax, through learning, found a SQL command, actually involved in a lot of linear algebra knowledge, this knowledge is now systematically recorded as follows:Merging data using relational algebra1 Relational algebraThe theoretical basis for merging data sets is relational algebra, which was proposed by E.f.codd in 1970.In the formal language of relational algebra:?
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 junction fields in the left tableINNER
Tags: record val not first A20 values error action equalHere is an example analysisTable A records the following:AID Anum1 a200501112 a200501123 a200501134 a200501145 a20050115Table B records the following:BID bname1 20060324012 20060324023 20060324034 20060324048 2006032408Create these two table SQL statements as follows:CREATE TABLE AAID Int (1) auto_increment PRIMARY KEY,Anum Char (20))CREATE TABLE B (BID Int (1) not NULL auto_increment PRIMARY KEY,Bname Char (20))INSERT into aVALUES (1, ' a2
There are two main differences:
1. The connection relationships are different. The record between two tables connected in relate mode can be "one-to-one", "many-to-one", and "one-to-many", while join (merge join) the two tables connected by the join method can only have one-to-one or multiple-to-one relationships, and cannot be merged.
2. display is different
Tag: object represents the Join parameter obj syntax contains local a20Left 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 junction fields in the left tableINNER JOIN
Tags: load http Select detail LAN margin src lin bleExcerpt from: http://blog.csdn.net/scythe666/article/details/51881235 By 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
Oracle connections are divided into the following types:Inner join ).Outer Join: Full join, left join, and right join ).Cross join ).
The outer join is different from the inner
Left JOIN, Inner join related content, very practical, for understanding the principle and specific applications are very helpful! The LEFT join is a shorthand for the left outer join, and the left join defaults to the outer property. The Inner
Label:Left 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 junction fields in the left tableINNER JOIN (equivalent join) returns only rows that have the same
SQL table connection left Join,right Join,inner join differenceLeft join returns records that include all the records in the left table and the equivalent of the junction fields in the right table (with the left table data as the baseline, not enough to null)Right join retur
Tags: using data sp on EF SQL C table relationshipLeft 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 junction fields in the left tableINNER JOIN (equivalent join
Left 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 junction fields in the left tableINNER JOIN (equivalent join) returns only rows that have the same
Label:Here is an example analysisTable A records the following:AID Anum1 a200501112 a200501123 a200501134 a200501145 a20050115Table B records the following:BID bname1 20060324012 20060324023 20060324034 20060324048 2006032408Create these two table SQL statements as follows:CREATE TABLE AAID Int (1) auto_increment PRIMARY KEY,Anum Char (20))CREATE TABLE B (BID Int (1) not NULL auto_increment PRIMARY KEY,Bname Char (20))INSERT into aVALUES (1, ' a20050111 '), (2, ' a20050112 '), (3, ' a20050113 ')
Within SQL Server, three types of inner join operations are implemented, and most people have never heard of these connection types since they are not logical connections and are rarely used in code. So when are they going to be used? The answer depends on the situation. This means that you have to rely on recordsets and indexes. The query optimizer always chooses the optimal physical connection type intelligently. We know that the SQL optimizer creat
Long time no contact with this query, since the switch software implementation, and understand the next.This article transferred from: http://www.cnblogs.com/pcjim/articles/799302.htmlFind this blog explained most clearlyleft join returns records that include all records in the left table and the equivalent of the junction fields in the right table. The right join returns records that include all records in
Label:First borrow the official explanation under: Inner JOIN (equivalent connection): Returns only rows with the same junction field in two tables; Left join: Returns records that include all 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 junc
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.