title: sql query to return single value based on column it matches
body: <p>I've a requirement where in if the query string matches column1 , return me 1. If it matches column 2 return 2 else if it matches column 3 return 3.</p>
  
  <p>Table strunctre:</p>
  
  <pre><code>col1   col2    col3
  
  11      12       13
  22      23       24
  </code></pre>
  
  <p>If my query string is 23, then i'm expecting a return value of 2 as it matches col2.</p>
  
  <p>Something like below:</p>
  
  <pre><code>select 1 
  from table1 
  where col1=querystring 
        and orderid=xxx 
        or select 2 from table1 
           where col2=querystring 
                 and orderid=xxx 
                 or select 3 from table1 
                    where col3=querystring  and orderid=xxx 
  </code></pre>
  
  <p>Basically i'm expecting one query which return single value based on the column it matches.</p>
  
  <p>Is it something doable in SQL as i'm not very good in DB skills.</p>
  
  <p>Any help is highly appreciated.</p>