title: How to using select with if condition in oracle?
body: <p>My requirement is to get a number from a complex query and check if the num = desiredNum.</p>
  
  <p>If it is equal to desiredNum, then I must perform another set of select statements,</p>
  
  <p>Is there any way I can achieve this in a query rather than writing a function?</p>
  
  <p>Eg: </p>
  
  <pre><code>select case when val =2  
  then select val1 from table1  
  else 'false'  
  from (select val from table)  
  </code></pre>
  
  <p>Is this possible ??</p>