title: Oracle SQL - Convert N rows' column values to N columns in 1 row
body: <p>The trick with this compared to the other questions (e.g. "Oracle convert rows to columns") is that my column values are arbitrary strings, rather than something I can use with decode. Take this query:</p>
  
  <p>The description table here maps people's names to descriptions, but each person can have multiple descriptions e.g. "wears a hat" or "is tall".</p>
  
  <pre><code>Select firstName, lastName, 
  (Select description from descriptions --This can return any number of rows (0 or more)
   where description.firstName = people.firstName
   and description.lastName = people.lastName
   and rownum &lt;= 3)
  from people
  where age &gt;= 25;
  </code></pre>
  
  <p>I would want an output like this:</p>
  
  <pre><code>FIRSTNAME LASTNAME DESCRIPTION1 DESCRIPTION2 DESCRIPTION3
  Jeremy    Smith    Tall         Confused        (null)
  Anne      Smith    (Null)       (Null)          (Null)
  Mark      Davis    Short        Smart           Strong
  </code></pre>
  
  <p>In the case of less than 3 descriptions, I want nulls there. In the case of more than 3 descriptions, I want to just leave them out.</p>
  
  <p>I am using Oracle 11.1. Can this be done efficiently?</p>