SQL inline syntax basic syntax (innerjoin) SELECT * FROM Table 1innerjoin table 2on table 1. userid table 2. useridsql inline syntax description: The preceding statement is used to query two tables, table 1 and table 2. If the userid fields in the two tables are the same, a row is displayed. 45it.com Note: The preceding syntax is equivalent to select * from table 1 and table 2.
SQL inline syntax basic syntax (inner join) SELECT * FROM table 1 inner join table 2 on table 1. userid = table 2. userid SQL inline syntax description: The preceding statement is used to query two tables, table 1 and table 2. If the userid fields in the two tables are the same, a row is displayed. 45it.com Note: The preceding syntax is equivalent to select * from table 1 and table 2.
SQL inline syntax (inner join)
SELECT * FROM table 1 inner join table 2 on table 1. userid = TABLE 2. userid
SQL inline syntax description: The preceding statement queries two tables, table 1 and table 2. If the userid fields in the two tables are the same, a row is displayed.
45it.com Note: The above syntax is equivalent to select * from table 1, Table 2 where Table 1. userid = TABLE 2. userid. If SQL inline is used, a lot of efficiency will be improved.
SQL left join syntax (left outer join)
SELECT * FROM table 1 left outer join table 2 ON table 1. userid = TABLE 2. userid
SQL left join syntax description: displays all rows in table 1, and displays all data in table 2 that meet the conditions in the result set, if any of the non-conforming data in table 2 is not displayed in the result set, it is displayed as null.
SQL right join syntax (right outer join)
SELECT * FROM table 1 right outer join table 2 ON table 1. userid = TABLE 2. userid
SQL left join syntax description: displays all rows in table 2, and displays all data that meet the conditions in table 1 to the result set, if none of the data in the left table 1 is displayed in the result set, it is displayed as null.
Full outer join)
SELECT * FROM table 1 full outer join table 2 ON table 1. userid = TABLE 2. userid
SQL left join syntax description: The above SQL full join means to display all rows in tables 1 and 2. Simply put, it means to combine all rows in tables 1 and 2, then, duplicate data is filtered out and displayed in the result set.