Select "answer"
from 'Details'
where "question" like 'child'
AND "subject" IN (select "subject"
from 'Details'
where "question" like 'child'
AND "answer" = "M" and "test" ="1");
表结构是:
Subject Test Survey Question answer
----------------------------------------------------
rahul 1 one childimmunization Yes
rahul 1 one childgender M
Jyothi 1 one childimmunization No
Jyothi 1 one childgender F
Chikku 1 one childimmunization No
Chikku 1 one childgender M