title: Find out the total call duration happened between 2 people
body: <p>I want to find out the call duration between 2 persons through SQL.
  Say "Joe" calling "Mak" and spoke 5 minutes and "Mak" calling "Joe" for 15 minutes then total duration must be 20 minutes.</p>
  
  <p>I tried something with self join but getting duplicates for such calls.</p>
  
  <pre><code>SELECT t1.cal1, t2.cal2,sum(t1.dur) as Total 
  from tele t1
  INNER JOIN   tele t2
  ON (t1.cal1 = t2.cal1 AND t1.cal2 = t2.cal2)
  GROUP BY T1.CAL1, T2.CAL2;
  
  cal1       cal2    duration (in Mins)
  A           B        5
  A           B       10
  B           A       10
  B           A       25
  A           D        1
  D           C        2
  B           C        4
  C           B        9
  C           B        7
  C           A        2
  D           C        5
  D           B       10
  </code></pre>