title: SQL info shown in one row
body: <pre><code>SELECT CA.MEMBER_ID,
      0 AS TRANSFERRED_SHARES ,
      SUM(CA.NUMBER_OF_SHARES) AS PURCHASED_SHARES, 
      '-' AS DELETED_SHARES
  FROM COS_APPLICATIONS CA , COS_APPL_DETAILS CAD
  WHERE APPL_TYPE =2
      AND CA.APPLICATION_ID = CAD.APPLICATION_ID
      AND CA.SERVICE_PRODUCT = 38002
      AND CAD.TRX_TYPE = 'INITIAL'
      AND CAD.TRX_UNIT = 143
      GROUP BY CA.MEMBER_ID
  UNION ALL
  SELECT CA.MEMBER_ID,
      SUM(CA.NUMBER_OF_SHARES) AS TRANSFERRED_SHARES, 
      0 AS PURCHASED_SHARES ,
      '-' AS DELETED_SHARES
  FROM COS_APPLICATIONS CA , COS_APPL_DETAILS CAD
  WHERE APPL_TYPE =5
     AND CA.APPLICATION_ID = CAD.APPLICATION_ID
     AND CA.SERVICE_PRODUCT = 38002
     AND CAD.TRX_TYPE = 'INITIAL'
     AND CAD.TRX_UNIT = 143 
     GROUP BY CA.MEMBER_ID
     ORDER BY CA.MEMBER_ID
  </code></pre>
  
  <p>I get the following results:</p>
  
  <p>My issue is that when a Member has both transferred and purchased shares,i want the info in one row , and not seperately.
  E.g. a member with the ID 63, has 31 Tranferred Shares and 50 Purchased.My query gives me 2 rows : the first one has 0 for the transferred and 50 for the purchased, and the second one has 31 for the transferred and 0 for the purchased. All i want is this info is shown in one row.</p>
  
  <p>Unfortunately i can't attach any image yet.</p>
  
  <p>Note! I execute this query in SQL Server 2012.</p>
  
  <p>Any ideas? 
  Thanks in advance! </p>