SELECT patient.P_ID, patient.P_NAME, patient.P_AGE,
patient.P_GENDER, patient.ADDRESS, patient.DOA,
patient.P_ID DIAGNOSE
FROM patient,presciption
WHERE patient.P_ID != presciption.P_ID
答案 0 :(得分:2)
只要在预告表中找不到患者,请使用NOT EXISTS
返回患者:
select patient.P_ID, patient.P_NAME, patient.P_AGE, patient.P_GENDER, patient.ADDRESS, patient.DOA, patient.P_ID DIAGNOSE
from patient
where not exists (select 1 from presciption
where patient.P_ID = presciption.P_ID)