1, left outside the connection to leave outer join, or leaving Jion,outer can be omitted to write, the bottom of the right connection and full connection is the same:
The left outer join means that the data in the table on the left side of the right join is the benchmark, that is, all the tables in the left must be displayed, such as:
In the first query here, the company table is on the left, so it is based on company, so the results shown are shown in addition to the same 6 data in the company, depart_id the other one that exists in company.
In the second query, the EMP on the left, the EMP as the benchmark, so the results shown in addition to depart_id the same 6, but also the EMP in the presence of another show out.
2, right outside the connection to join:
From the top of the query two queries, except the field order of the different, and left outer JOIN operation is very similar. Only one is based on the table on the left side of the join, and the other is based on the table on the right side of the join. (Some friends say that the performance of the left join is better, this is for the time being, wait until the performance test to say again)
3, fully connected full join, this and the above slightly different is that the syntax is not used behind the join on, the direct Select field name from the tablename1 full join tablename2, and its results will also appear before the Cartesian product phenomenon, This is the display (the number of fields in table 1 plus the number of fields in table two) a field that displays (the number of records in table one multiplied by the number of records in table two) records;
MySQL Common basic operation Syntax (ix) ~ ~ Outer JOIN query "command line mode"