title: Ibatis SQL query
body: <p>I have the below query :</p>
  
  <pre><code>   Select top 20 * from tab 
  --(first query)
     union all
     Select '0' as id,'PR' as BU,tab.name,tab.desc from tablename tab
    inner join tablename1 tab1 ON tab1.name=tab.name and tab1.desc=tab.desc               
  --(second query)
    union all
    Select '0' as id,'BR' as BU,tab.name,tab.desc from tablename tab
    inner join tablename1 tab1 ON tab1.name=tab.name and tab1.desc=tab.desc
  --(third query)
  </code></pre>
  
  <p>Here i am trying to put the filter in the above query if i pass 'PR' as BU it should give me results of query 1 and query 2 but right now it is giving me results of all the three queries.
  I need the results on basis of parameter of BU</p>