filmov
tv
12 MySQL Tutorial for Beginners: Inner Joins
Показать описание
An inner join lets you combine columns from two or more tables into a single result set.
To join data from two tables, you code the name of the first table in the FROM clause and the name of the second table within the JOIN keyword.
You can code an ON phrase to specify a join condition and filter the results.
Note that if the joined tables contain columns that share the same name, you must qualify them with their table name so MySQL can distinguish between them.
To code a qualified column name, you enter the table name and a period in front of the column name.
If you forget to qualify those columns, MySQL returns an error indicating that the column name is ambiguous.
Sometimes you’ll see the JOIN keyword preceded by the INNER keyword.
This keyword is optional and can be omitted.
Although you code most inner joins using the equal operator, you can compare two tables based on other conditions too.
For example, you can use the greater than or less than operators for an inner join condition.
You may occasionally need to join to a table that's in another database. In this case you need to qualify that table with the name of the database.
Remember to qualify an ambiguous column name anywhere it appears in the statement.
EXERCISES for your SELF-TRAINING:
SCRIPT FOR THE EXAMPLES:
SUBSCRIBE!
FACEBOOK
GOOGLE+
To join data from two tables, you code the name of the first table in the FROM clause and the name of the second table within the JOIN keyword.
You can code an ON phrase to specify a join condition and filter the results.
Note that if the joined tables contain columns that share the same name, you must qualify them with their table name so MySQL can distinguish between them.
To code a qualified column name, you enter the table name and a period in front of the column name.
If you forget to qualify those columns, MySQL returns an error indicating that the column name is ambiguous.
Sometimes you’ll see the JOIN keyword preceded by the INNER keyword.
This keyword is optional and can be omitted.
Although you code most inner joins using the equal operator, you can compare two tables based on other conditions too.
For example, you can use the greater than or less than operators for an inner join condition.
You may occasionally need to join to a table that's in another database. In this case you need to qualify that table with the name of the database.
Remember to qualify an ambiguous column name anywhere it appears in the statement.
EXERCISES for your SELF-TRAINING:
SCRIPT FOR THE EXAMPLES:
SUBSCRIBE!
GOOGLE+
Комментарии