Gunakan:
SELECT a.AccountNo,
a.ParcelNo,
a.LocalNo,
a.PrimaryUseCode,
a.DefaultTaxDistrict,
TRIM(g.Section),
TRIM(g.Township),
TRIM(g.Range)
FROM tblAcct A
LEFT JOIN tblAcctLegalLocation g ON g.accountno = a.accountno
AND g.verstart <= '20100917999'
AND g.verend > '20100917999'
WHERE a.verstart <= '20100917999'
AND a.verend > '20100917999'
AND a.DefaultTaxDistrict = '2291'
AND SUBSTR(a.AccountNo,1,1) IN ('R', 'I')
AND SUBSTR(a.ParcelNo,1,1) NOT IN ('7', '8')
AND a.AcctStatusCode IN ('A', 'T', 'E')
ORDER BY a.ParcelNo, a.LocalNo
Semua yang Anda lihat ditandai dengan (+)
harus dimasukkan dalam kriteria OUTER join. Dalam JOIN luar, kriteria diterapkan sebelum bergabung.