title: Left outer join on multiple tables
body: <p>I have the following sql statement: </p>
  
  <pre><code>    select  
      a.desc
     ,sum(bdd.amount)
     from t_main c 
     left outer join t_direct bds on (bds.repid=c.id) 
     left outer join tm_defination def a on (a.id =bds.sId)
     where c.repId=1000000134
     group by a.desc;
  </code></pre>
  
  <p>When I run it I get the following result:</p>
  
  <pre><code>   desc       amount
     NW         12.00
     SW         10
  </code></pre>
  
  <p>When I try to add another left outer join to get another set of values:</p>
  
  <pre><code>   select  
      a.desc
     ,sum(bdd.amount)
     ,sum(i.amt)
     from t_main c 
     left outer join t_direct bds on (bds.repid=c.id) 
     left outer join tm_defination def a on (a.id =bdd.sId)
     left outer join t_ind i on (i.id=c.id)
     where c.repId=1000000134
     group by a.desc;
  </code></pre>
  
  <p>It basically doubles the amount field like:</p>
  
  <pre><code>         desc    amount   amt
           NW       24.00   234.00
           SE       20.00   234.00
  </code></pre>
  
  <p>While result should be: </p>
  
  <pre><code>        desc   amount   amt
          NW      12.00   234.00
          SE      10.00   NULL 
  </code></pre>
  
  <p>How do I fix this?</p>