Basic explicit inner join

Download sql eBook

Example

A basic join (also called "inner join") queries data from two tables, with their relationship defined in a join clause.

The following example will select employees' first names (FName) from the Employees table and the name of the department they work for (Name) from the Departments table:

SELECT Employees.FName, Departments.Name
FROM   Employees
JOIN   Departments
ON Employees.DepartmentId = Departments.Id

This would return the following from the example database:

Employees.FNameDepartments.Name
JamesHR
JohnHR
RichardSales

Stats

Contributors: 6
2017-01-24
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook