title: How to join multiple rows from same table in single row
body: <p>I have this query. also please find following  for table schema </p>
  
  <p><a href="http://sqlfiddle.com/#!2/36d20/14" rel="nofollow">http://sqlfiddle.com/#!2/36d20/14</a></p>
  
  <pre><code>SELECT
    ca1.*,
    ca2.*
  FROM Contact_Address AS ca1
    JOIN Contact_Address AS ca2
      ON ca1.ca_contact_id = ca2.ca_contact_id
  WHERE ca1.ca_contact_id = 1
      AND ca1.ca_type = 'PRI'
      AND ca2.ca_type = 'SEC'
  </code></pre>
  
  <p>I have to combine two rows which are contained in same table into single row.they contain type 'PRI','SEC'.But the condition is that for one user it will contain both rows and for another it will contain only one.</p>
  
  <p>Please help,
  thanks</p>