Postgresql: Is the following select reasonable/possible?
<p>A customer would like me to create a dataset as the shown below. I have no idea if this is possible or logical.</p>

<p>I have table <strong>parent</strong>:</p>

<pre><code>id       name 
-------  -------
1        parent1
2        parent2
3        parent3
</code></pre>

<p>And table <strong>child</strong>:</p>

<pre><code>id       parent   name     age
-------  -------  -------  -------
1        1        child1   2
2        1        child2   4
3        1        child3   7
4        2        child12  5
</code></pre>

<p>I would like to make a select query to return the following for <strong>parent1</strong>:</p>

<pre><code>parent   child1   child2   child3
-------  -------  -------  -------
parent1  2        4        7
</code></pre>

<p>And of course return the following for <strong>parent2</strong>:</p>

<pre><code>parent   child12
-------  -------
parent2  5      
</code></pre>

<p>Anyone has a solution for this, or a creative comment?</p>