title: Query to get multiple row values into multiple columns
body: <p>I have a CSV file with 2 columns . </p>
  
  <pre><code>Empid | SID 
  :-----|-----:
  12312 | S-1-5-21-3751615294 
  12312 | S-1-5-21-3751615298  
  12312 | S-1-5-21-3751615292 
  12313 | S-1-5-21-3751615294-5078 
  13546 | S-1-5-21-3751615294-50725
  12312 | S-1-5-21-3751615291
  14151 | S-1-5-21-3751615294-50722
  </code></pre>
  
  <p>For an Empid there are multiple SIDs available .I need help writing a sql SELECT query that can map(and store) these SIDs(sorted) into multiple columns.</p>
  
  <p>Desired SQL Select output is below :-</p>
  
  <pre><code>+--------+---------------------------+---------------------+--------------------+--------------------+
  | Empid  |    SID1                   |        SID2         |        SID3        |        SID4        |
  +--------+---------------------------+---------------------+--------------------+--------------------+
  | 12312  | S-1-5-21-3751-65291       | S-1-5-21-375165292  | S-1-5-21-375165294 | S-1-5-21-375165298 |
  | 12313  | S-1-5-21-3751615294-5078  | NULL                | NULL               | NULL               |
  | 13546  | S-1-5-21-3751615294-50725 | NULL                | NULL               | NULL               |
  +--------+---------------------------+---------------------+--------------------+--------------------+
  </code></pre>
  
  <p>I am collecting an employee record in my application collector(using sql select queries) from a CSV file and need to collect these SIDs in his record .Maximum 4 SIDs can be possible so I created 4 attributes for SIDs .</p>
  
  <p>Thanks in advance .</p>