I have this validation in one subquery
CASE WHEN value1 IN (\'home\',\'xyz\',\'people\',\'etc\') AND ((instr(n.notetext,\'Email & Letter Sent\')>=1) OR (instr(