I’ve got a table for properties, and I’ve got a table for tenants. I need a query so that I can display all of the properties, and if they have tenants, then that data would be included. Sometimes there are no tenants. My current query breaks if there are no tenants.
SELECT
p.*,
t.first-name
AS tenant-first-name
,
t.last-name
AS tenant-last-name
FROM property
p
LEFT JOIN tenant
t ON p.id
= t.property-id
What can I do here so that if there are no tenants, the query still returns the property data?