the records of Table A, a can be regarded as the 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
, 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 foll
aNum bid bname 1 a20050111 1 2006032401 2 a20050112 2 2006032402 3 a20050113 3 2006032403 4 a20050114 4 2006032404 5 a20050115 null NULL (the number of rows affected is 5 rows) The results show that the left join is based on the records of a table, a can be regarded as the 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 dis
codeUpdate (ctarticle AS a left join (ctnclass AS c left join ctclass AS d ON c. classid = d. classid) ON. nclassid = c. nclassid AND. classid = c. classid) left join cttag AS B ON. articleid = B. articleid SET tag = d. class + ''+ c. nclass, B. articleid =. articleid, B. classid =. classid, B. nclassid =. nclassid Where. classid = 23 AND. nclassid= 197;
7.5 upd
Label:Table A records the following:AID Anum1 a200501112 a200501123 a200501134 a200501145 a20050115Table B records the following:BID bname1 20060324012 20060324023 20060324034 20060324048 2006032408----------------------------------------The 1.LEFT join SQL statement is as follows: SELECT * from A LEFT join B on a.aid = B.bidThe results are as follows:AID Anum BI
left join is based on the records of Table A, a can be regarded as the 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
number of rows affected is 5 rows)Result Description:The left join is based on the records of Table A, a can be regarded as the 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.----------
Label:Simply and clearly, connect to the inner and outer links. Suppose there are two tables of A and B Internal connection: Inner JOIN indicates that the record of the AB table is displayed, excluding the condition of the AB table . There are three kinds of outer joins, that is, left OUTER joins, right connection, OUTER join
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 A right join B on a.aid = B.bidThe results are
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
the records of Table A, a can be regarded as the 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
represented, and the right table (B) will only display records that match the search criteria (in the example: A.aid = b.bid). b table records are not sufficient for the place are null. 2.right join sql statements are as follows: Select from A
Join B on
A. AID = B.bid The results are as follows:AID Anum BID b
Tags: www. POS nbsp Join table data Intersection case tagThe 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, with their previous understan
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 B
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 B
, 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 foll
, 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 foll
The 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 junction fields in the left table;INNER JOIN (equivalent join)
can be regarded as the left table, and the leftmost join is based on the. 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 B table does not have enough records to be null. The -------------------------------------------- 2.right
statement is as follows: Select * from A Right Join b on a.aid = B.bid The results are as follows: AID anum BID bname 1 A1 NBSP;NBS P 1 NBSP;B1 2 a2 2 NB Sp B2 3 A3 NBSP;NBSP; 3 B3 null null NBSP; 8 B8 (The number of rows affected is 4 rows)Result Description:Looking closely, you will find that the result of the left join is exactly the opposite, t
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.