filmov
tv
14 MySQL Tutorial for Beginners: Outer Joins, Cross Joins
![preview_player](https://i.ytimg.com/vi/x4jJVNsMWDA/maxresdefault.jpg)
Показать описание
When you code an outer join, you include the LEFT or RIGHT keyword to specify the type of outer join you want to perform.
An outer join retrieves all rows that satisfy the join condition, plus unmatched rows in the left or right table.
Note that when a row with unmatched columns is retrieved, any columns from the other table are given null values.
Sometimes you will see the OUTER keyword as shown by this example.
This keyword is optional and can be omitted.
When coding outer joins, it's a common practice to avoid using right joins.
Therefore, you should always rephrase a right join to a left join.
To do that, reverse the order of the tables in the FROM clause and use the LEFT keyword instead of RIGHT.
You can also use outer joins to work with more than two tables.
To do that, you use skills similar to those that you use to work with inner joins.
You can also combine inner joins and outer joins in the same query.
A cross join produces a result set that includes each row from the first table joined with each row from the second table.
EXERCISES for your SELF-TRAINING:
SCRIPT FOR THE EXAMPLES:
SUBSCRIBE!
FACEBOOK
GOOGLE+
An outer join retrieves all rows that satisfy the join condition, plus unmatched rows in the left or right table.
Note that when a row with unmatched columns is retrieved, any columns from the other table are given null values.
Sometimes you will see the OUTER keyword as shown by this example.
This keyword is optional and can be omitted.
When coding outer joins, it's a common practice to avoid using right joins.
Therefore, you should always rephrase a right join to a left join.
To do that, reverse the order of the tables in the FROM clause and use the LEFT keyword instead of RIGHT.
You can also use outer joins to work with more than two tables.
To do that, you use skills similar to those that you use to work with inner joins.
You can also combine inner joins and outer joins in the same query.
A cross join produces a result set that includes each row from the first table joined with each row from the second table.
EXERCISES for your SELF-TRAINING:
SCRIPT FOR THE EXAMPLES:
SUBSCRIBE!
GOOGLE+