INNER join (equivalent join) returns only rows with the same join field in two tables
Left JOIN, which returns records that include all records in the left table and the join fields in the right table
Right join returns records that include all the records in the right table and the join fields in the left table
INNER JOIN Syntax:
INNER join joins two datasheet usage:
The code is as follows |
Copy Code |
SELECT * FROM table 1 INNER JOIN table 2 on table 1. Field number = Table 2. Field number |
INNER join joins three datasheet usage:
The code is as follows |
Copy Code |
SELECT * FROM (table 1 INNER join 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 joins four datasheet usage:
The code is as follows |
Copy Code |
SELECT * FROM (table 1 INNER JOIN 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. |
INNER join joins five datasheet usage:
The code is as follows |
Copy Code |
SELECT * FROM ((table 1 INNER JOIN 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 No. NER JOIN table 5 on member. Field number = Table 5. Field number |
SELECT Tx_txurheber_urheber.uid, Tx_txurheber_urheber.werkxurhadrd_kurzname, Tx_vda_werke.d_werksart
From Tx_txurheber_urheber
INNER JOIN Tx_vda_werke on tx_txurheber_urheber.fk_werk = Tx_vda_werke._pk_werk
and Tx_vda_werke.d_werksart = ' theater '
LIMIT 0, 30
Connection six data table usage: slightly, similar to the above join method, everybody extrapolate bar:
Note:
• In the process of entering letters, be sure to use the English half angle punctuation mark, leave half a space between the words;
• When a table is set up, if one is joined to more than one table, the field in the table must be of the number data type, and the same field in more than one table must be a primary key and an AutoNumber The data type. Otherwise, it is difficult to connect successfully.
• Code Nesting Quick methods: For example, to connect five tables, simply add a front and back bracket to the code that connects the four tables (the parentheses are appended to the from, the parentheses are appended to the end of the code), and then continue with the INNER JOIN table name x on table 1 after the parentheses. Field number = Table x. Field number code, so that you can join the datasheet indefinitely:)