nvl , Where, IN clauses
<p>Is this correct?</p>

<pre><code>select * from t1
where nvl(t1.a,t1.b) in (select id from t2 where name = 'Apple')
</code></pre>

<p>a,b are the columns in t1 for the Id from t2.</p>

<p>I want all the rows that have id for 'Apple' either in t1.a or t1.b</p>

<p>if a is null, id will be in b. </p>

<p>if b is null, id will be in a.</p>