title: compare column to values from procedure
body: <p>I have a list of values to evaluate. Example provided below</p>
  
  <pre><code>'16-%', '45-%','A1%','125%'
  </code></pre>
  
  <p>I then have 1 column that is the output of a stored procedure and 4 columns that get returned from aliased left outer joins</p>
  
  <p>example :</p>
  
  <pre><code>Max(db_util.Efn_name_wid(tdl_tran.reason_code_id, 
                 remit_rmc.remit_code_id, remit_rmc.remit_code_name, 'Reason')
  ) AS DEN_REASON
  
  , Max(RMC_1.remit_code_name) 
         AS REMIT_CD1
  
  ,Max(RMC_2.remit_code_name) 
         AS REMIT_CD2
  
  ,Max(RMC_3.remit_code_name) 
         AS REMIT_CD3
  
  ,Max(RMC_4.remit_code_name) 
         AS REMIT_CD4
  </code></pre>
  
  <p>The logic I am trying to build is this:   </p>
  
  <p>IF DEN_REASON like (any value in the list)</p>
  
  <p>THEN evaluate column remit_cd1 against the same list, if it matches any value in the list, then continue to remit_cd2,remit_cd3, remit_cd4 until it finds the first remit code that doesn't match the value in the list. </p>
  
  <p>Ultimately trying to return one value.</p>