join column. If a row in the left table does not match a row in the right table, all selection list columns in the right table in the row of the associated result set are null.Right join or right outer join.The right outer connection is the reverse connection of the left outer connection. All rows in the right table are returned. If a row in the right table does not match a row in the left table, a null va
element in a to match the result of all elements in B, that is, the n*m combination.
SELECT * from A cross JOIN B
AA BB
-------- --------
Item 1 Item 3 ^
Item 1 Item 4 +--- the first element in a, matching all elements in B
Item 1 Item 5 |
Item 1 Item 6 v
Item 2 Item 3 ^
Item 2 Item 4 +--- a second element that matches all elements in B
Item 2 Item 5 |
Item 2 Item 6 v
table 2 on table 1. Field number = Table 2. Field number) INNER join table 3 on table 1. Field number = Table 3. Field number) INNER join table 4 on Member. Field number = Table 4. Field number) in NER JOIN table 5 on Member. Field number = Table 5. Field number Connect si
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 joinThe SQL statement is as follows:
select * from A right join B on A.aID = B.bID
The result is as follows:Aid anum bid bname1 a20050111 1 20060324012
Categories.CategoryID.You can also link multiple on clauses in a JOIN statement, using the following syntax:SELECT fieldsFrom table1 INNER JOIN table2On table1.field1 compopr table2.field1 andOn table1.field2 compopr table2.field2 OROn table1.field3 compopr table2.field3;You can also nest JOIN statements with the foll
Categories.CategoryID.You can also link multiple on clauses in a JOIN statement, using the following syntax:SELECT fieldsFrom table1 INNER JOIN table2On table1.field1 compopr table2.field1 andOn table1.field2 compopr table2.field2 OROn table1.field3 compopr table2.field3;You can also nest JOIN statements with the foll
a20050113 3 20060324034 a20050114 4 20060324045 a20050115 NULL NULL(The 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 ex
list column for the other table contains a null value. If there are matching rows between the tables, the entire result set row contains the data values of the base table.(2) SQL statementsSELECT * FROM table1 full join table2 on Table1.id=table2.id-------------Results-------------ID Name ID Score------------------------------1 Lee 1 902 Zhang 2 1004 Wang Null NULLNULL NULL 3 70----------------------------
Http://www.blogjava.net/zolly/archive/2007/10/23/SQLJION.html
The join condition can be specified in the from or where clause. We recommend that you specify the join condition in the from clause. The where and having clauses can also contain search conditions to further filter the rows selected by the join conditions. Connections can be divided into the followin
Differences between inner join, left JOIN, right join, outer join in SQLFor example, you'll know!Table A (A1,B1,C1) b (A2,B2)A1 B1 C1 A2 B201 Mathematics 95 01 Sheets Three02 Language 90 02 John Doe English Harry Select A.*, b.* f
Let's start by looking at the results of the left join and the right join and the Inner join and the full join working on the table.
Create a new two table in the database and insert the data you want to test.
New table:[SQ
Tags: http strong ar Data div sp on ad efLet's start by looking at the results of the left join and the right join and the Inner join and the full join working on the table.
Create a new two table in the database and insert the data you want to test.
New table:[
Rutabaga
Pirate
Darth Vade
Ninja
All listed. (3) Note:SELECT * from TableAUNIONSELECT * from TableB
new result set
ID
name
1
Pirate
2
Monkey
3
Ninja
4
spaghetti
1
rutabaga
2
Pirate
3
Darth vade
Label:Original: http://blog.csdn.net/shadowyelling/article/details/7684714Left Join: Returns all the information in the table on the right and the information related to the left table conditionRight Join: Returns all of the information in the table in the list and information about the right table condition in the left tableInner Join: Returns information common
Update Update Xxx Set Xxx Where As we all know about this writing, we found that update and delete support the update method of inner join, which is very useful for updating and deleting operations between tables. Column: SQLCode Update Tb_user Set Pass = '' From Tb_user USR Inner Join Tb_address ADDR
This article is reproduced in SQL using update inner join and delete inner join.
Because the Update Connection statement is required when processing data in the project, the update inner join
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 a20050111 1 20060324012 a20050112 2 20060324023 a20050113 3 20060324034 a20050114 4 2006032
SQL left join, right join, and inner join
Today, I chatted with a friend about a small problem in their company. As follows:
Table A device table stores MAC addresses, provinces, cities, and zones.Table B Software Table, which stores MAC addresses and software names.You can
number = Table 2. Field number) INNER join table 3 on table 1. Field number = Table 3. Field number) INNER join table 4 on Member. Field number = Table 4. Field number) in NER JOIN table 5 on Member. Field number = Table 5. Field numberConnect six data tables using: Slightl
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.