SELECT familyname
FROM dtoohey.patient, DTOOHEY.account, dtoohey.doctor
WHERE dtoohey.account.patientID = dtoohey.patient.patientid
AND dtoohey.doctor.providerno = DTOOHEY.account.providerno
AND dtoohey.doctor.name = 'Dr Brian';
SELECT familyname
FROM dtoohey.patient
WHERE patientid IN (
SELECT patientid
FROM dtoohey.account
WHERE providerno IN (
SELECT providerno
FROM dtoohey.doctor
WHERE name = 'Dr Brian'
)
);
这两者有什么区别?两者都给出不同的结果。