title: Selecting same column list for different where conditions
body: <p>I have a stored procedure returning same columns according to different parameters.</p>
  
  <p>for example;</p>
  
  <pre><code>if name is not null
  select a,b,c,d,e,f
  from table1, table2, table3
  where .....
  
  if age is not null
  select a,b,c,d,e,f
  from table1, table2, table3,table4
  where .....
  
  if city is not null
  select a,b,c,d,e,f
  from table1,table3,table5
  where .....
  </code></pre>
  
  <p>The problem is when I want to add/omit columns I will need to do it for every select.</p>
  
  <p>Is there any way to keep column list once and use it for different where conditions?</p>