Multiple joins

A query can chain several joins to link more than two tables. Each join is added to the result of the previous one. Watch the cardinality: a one-to-many join multiplies rows and can skew aggregates if you sum repeated values.

Example

FROM commandes o
JOIN clients c ON c.id = o.client_id
JOIN lignes l ON l.commande_id = o.id

Related concepts

The whole glossary