Skip to content
ParticleDB
Release candidateParticleDB 1.1.19-rc.17 is not yet GA or ready for production data.Release status →

Join related records

Combine records using explicit relationships.

CREATE TABLE docs_accounts (id BIGINT PRIMARY KEY, name TEXT);
CREATE TABLE docs_requests (id BIGINT PRIMARY KEY, account_id BIGINT, title TEXT);
INSERT INTO docs_accounts VALUES (7, 'Acme');
INSERT INTO docs_requests VALUES (1, 7, 'Review request');
SELECT a.name, r.title
FROM docs_accounts a
JOIN docs_requests r ON r.account_id = a.id
ORDER BY r.id;

The result combines Acme and Review request. An inner join excludes unmatched rows. Use a left join when unmatched records must remain. Ensure the join key has the cardinality your application expects.

SQL reference · Application guide · Troubleshooting