You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing a multi-table join means knowing the foreign keys by heart. The schema already holds them and the ER diagram already draws them (features/er-diagram.mdx), but neither can produce the query. Autocomplete offers tables after JOIN and columns after ON (features/autocomplete.mdx), but never a join condition built from a foreign key.
Proposed solution
Pick tables, and the builder proposes join conditions from the foreign keys between them, including through a junction table for a many-to-many pair.
Choose columns per table, add conditions, and see the generated SQL update as you go, quoted for the connection's engine.
Open the result in a normal query tab, editable as text from then on. This generates a starting query, it does not replace writing SQL.
Reachable from the ER diagram by selecting two related tables.
Done means picking orders and customers writes SELECT … FROM orders JOIN customers ON orders.customer_id = customers.id into a new query tab without typing the condition.
Alternatives considered
Read the structure tab and write the join by hand.
Activity