title: Oracle CASE in WHERE clause
body: <p>Can someone help me with the below query in oracle?<br>
  The logic is that if the person has a friendlyname , use that for match with the 'search' criterion. Else, try to match with the realname column.  </p>
  
  <pre><code>select * from people where   
  case when customer_friendlyname is null then realname like '%abcd%'  
  else   
  case when customer_friendlyname is not null then customer_friendlyname like '%abcd%'  
  end   
  end  
  </code></pre>
  
  <p>Appreciated if someone could take a look.. Thank you!  </p>