Deviopath › PostgreSQL

Readable Order Lines

Medium · Joins

You can chain several JOINs in one query. Each JOIN ... ON adds one more table, matched by its key.

For every row in order_items, return order_id, customer (the customer's name), product (the product's name), quantity, and line_total (quantity * price). Sort by order_id, then product.

Next: One Contact List