PostgreSQL
PostgreSQL LEFT JOIN
Keep every row from the left table and matching rows from the right table.
Use LEFT JOIN
SELECT p.name, c.name AS category
FROM products AS p
LEFT JOIN categories AS c
ON c.id = p.category_id;Products without a category are still returned; the category columns are NULL.