I’m trying to return some values optionally (if they exist) and if not return the rest of the set.
SELECT people.first_name, countries1.name AS "Country1"
FROM addressbook_people AS people
JOIN root_countries AS countries1 ON people.country1 = countries1.id
On some cases there will be no value supplied for people.country1,
however if one it not supplied no results.
How would I restructure this query to still return people.first_name
when there is no value in people.country1?
Just do
which will result to returning
NULLon the respective fields of theroot_countriestable.