Person No Address
Result ::
SELECT p.HOSPCODE, p.CID, p.PRENAME, p.NAME, p.LNAME, p.BIRTH, p.SEX, p.TYPEAREA,
a.HOUSENO, a.VILLANAME, a.VILLAGE, a.TAMBON, a.AMPUR, a.CHANGWAT
FROM person p
LEFT OUTER JOIN address a ON a.HOSPCODE = p.HOSPCODE AND a.PID = p.PID
WHERE p.DISCHARGE = '9' AND p.NATION = '099'
AND p.TYPEAREA='4' AND a.CHANGWAT IS NULL
Result ::