Relocate the predicate
GG.IDParent = 'usa'
WHERE clause to the
ON clause of the
In the WHERE clause, that predicate negates the "outerness" of the LEFT JOIN. Any rows that don't have a "matching" row from
GG, all of the
GG. columns will be NULL, and those rows won't satisfy that predicate in the
LEFT JOIN gw_geog GG ON GG.IDArea = GS.IDArea AND GG.IDParent = 'usa' ^^^^^^^^^^^^^^^^^^^^^^^