Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 397 Bytes

Combine Two Tables.md

File metadata and controls

26 lines (17 loc) · 397 Bytes

MySQL Solution

SELECT FirstName, LastName, City, State FROM Person
LEFT JOIN Address USING(PersonId)

Notes

We could also replace

USING(PersonId)

with

ON Person.PersonId = Address.PersonId

The ON clause is used to join tables where the column names don’t match in both tables.

Links