title: SQL: Rearranging table to get unique combinations
body: <p>I have a table that essentially contains two fields; transactionnumber and productnumber. A transaction can contain several products. Currently the table is given as follows:</p>
  
  <pre>
   ---------
  | T1 | P1 |
  | T1 | P2 |
  | T2 | P2 |
  | T2 | P3 |
  | T2 | P4 |
  | T3 | P1 |
  | T3 | P4 |
  | T4 | P1 |
  | T4 | P3 |
  | T4 | P5 |
   ---------
  </pre>
  
  <p>Instead I want to be able to count how the products are being sold together and therefore want each two combination of products for each transaction. (Sorry if I'm unclear) Here's how I want it:</p>
  
  <pre>
   ------------
  | T1 | P1, P2 |
  | T2 | P2, P3 |
  | T2 | P2, P4 |
  | T2 | P3, P4 |
  | T3 | P1, P4 |
  | T4 | P1, P3 |
  | T4 | P1, P5 |
  | T4 | P3, P5 |
   ------------
  </pre>
  
  <p>How can this be done? Thanks!</p>