```
-----------------------------------------------------------
-- 1.查詢患者檔案表 查詢檔案號 --
-----------------------------------------------------------
--姓名查詢(可能重復)
select * from foundation.com_patientinfo pa where pa.name = '王書';
--身份證查詢(唯一)
select * from foundation.com_patientinfo pa where pa.ide_no = '410521196006096511';
-----------------------------------------------------------
-- 2.查詢卡類型表(一個檔案號對應兩個卡類型,卡號和身份證)找到出錯的檔案號 --
-----------------------------------------------------------
select * from foundation.com_medical_card ca where ca.patient_id in ('PN00178004','PN00178005') order by ca.patient_id;
-----------------------------------------------------------
-- 查詢賬戶表 --
-----------------------------------------------------------
select * from opo.fin_opb_account ac where ac.patient_id in ('PN00178004','PN00178005') order by ac.patient_id;
-----------------------------------------------------------
-- 3.查詢就診信息(確認無門診或住院就診信息) --
-----------------------------------------------------------
--門診
select * from opo.cdr_opr_radt_register re where re.patient_id in ('PN00178004','PN00178005');
--住院
select * from ipo.cdr_ipr_register ire where ire.patient_id in ('PN00178004','PN00178005');
--4.信息修改 (3個表分別點擊解鎖、刪除、確認->F10或運行按鈕右邊提交修改事務)
select pa.*,rowid from foundation.com_patientinfo pa where pa.patient_id = 'PN00178004';
select ca.*,rowid from foundation.com_medical_card ca where ca.patient_id = 'PN00178004';
select ac.*,rowid from opo.fin_opb_account ac where ac.patient_id = 'PN00178004';
```