title: make one select query using 2, the queries being operated on the same table
body: <p>Take 2 tables as input - Employee and salary as  </p>
  
  <pre><code>Employee            Salary  
  ID  Name            ID  Salary  
  1   Anshika         1   1000  
  2   Arnav           2   2000  
  3   Ishita          3   3000  
  4   Iti             4   4000  
  </code></pre>
  
  <p>Display output as--  </p>
  
  <pre><code>A       I  
  3000    7000 
  </code></pre>
  
  <p>I've written 2 queries as--  </p>
  
  <pre><code>    mysql&gt; select sum(salary) as sumA from salEmp where id in (select id from nameEmp where name LIKE 'A%');  
  
  output  
  
  sumA  
  3000
  </code></pre>
  
  <p>1 row in set (0.00 sec)   </p>
  
  <pre><code>    mysql&gt; select sum(salary) as sumI from salEmp where id in (select id from nameEmp where name LIKE 'I%');  
  
  output  
  
  sumI  
  7000
  </code></pre>
  
  <p>1 row in set (0.01 sec)  </p>
  
  <p>But I want to write a single query so that I can the desired output as in the question.  </p>
  
  <p>I tried--  </p>
  
  <pre><code>mysql&gt; select sum(a.salary) as sumA, sum(b.salary) as sumI
  -&gt;  from salEmp a,salEmp b
  -&gt;  where a.id in
  -&gt;          (select id from nameEmp where name LIKE 'A%')
  -&gt;  AND b.id in
  -&gt;          (select id from nameEmp where name LIKE 'I%');
  </code></pre>
  
  <p>but the output is as follows--  </p>
  
  <pre><code>sumA  sumI  
  6000  14000  
      1 row in set (0.00 sec) 
  </code></pre>
  
  <p>the values are doubled.<br>
  plz help in getting the original output...  </p>