Join (SQL)

From Wikiversity
Jump to navigation Jump to search

An SQL join clause combines records from two or more tables in a database.


Two tables[edit]

tblSuit
Suit Color
SuitClubs.svg Solid black.png
SuitSpades.svg Solid black.png
Suit Hearts.svg Solid red.png
SuitDiamonds.svg Solid red.png
tblLight
Light Color
Ampelmann Rot.svg Solid red.png
Ampelmann Grün.svg Solid green.png



Inner join
Venn0001.svg
SELECT * FROM tblSuit
JOIN tblLight ON tblSuit.Color = tblLight.Color
Suit tblSuit.Color Light tblLight.Color
Suit Hearts.svg Solid red.png Ampelmann Rot.svg Solid red.png
SuitDiamonds.svg Solid red.png Ampelmann Rot.svg Solid red.png



Three tables[edit]

ta
ca
va
yooo
te
ce
ve
yooo
tu
cu
vu
yooo