I have multiple tables in my Postgres database that are linked by a field called id
. My main table, Person
is linked to other tables Address
, Phone
andEmail
by id
.
This line of code gets information about the person from all tables in the database:
SELECT *
FROM "Person" p, "Address" a
WHERE p.id = a.id
This isn't showing rows where p.id
exists, but we don't have an address for that specific person yet (a.id != p.id
in any case).
How do I get the select statement to also return fields where a.id
is not found to contain p.id
?