select
disease_name
from
disease
where
disease_id=
(select disease_id from disease_symptom where
disease.disease_id=disease_symptom.disease_id AND
symptom_id=
(select symptom_id from symptom where symptom.symptom_id=disease_symptom.symptom_id
AND symptom_name='fever' OR symptom_name='head ache'))
Gives an error that subquery returns more than one row. what is the cause?
disease_id
cannot equal multiple values. This query would be better written withJOIN
s instead of subqueries. – Leucoplast