select o.hospitalcode as PCUCODE
,p.cid as CID
, p.cid as PERSON_ID
,t.pcode as INSTYPE
,p.pttype_no as INSID
,p.pttype_begin_date as START_DATE
,p.pttype_expire_date as EXPIR_DATE
,p.pttype_hospmain as MAIN
,p.pttype_hospsub as SUB
,p.last_update_pttype as UPDATE_DATE
from person p
left join pttype t on t.pttype = p.pttype
cross join opdconfig o
ละลองดูครับ