How can I take two rows for one Distinct value in postgresql?
<p>I want to get two rows of distinct column2 from following table.</p>

<pre><code>demo_table 
id  | column1 | column2
 1  |    1    |    3
 2  |    2    |    3
 3  |    3    |    4
 4  |    4    |    3
 5  |    5    |    4
 6  |    6    |    3
</code></pre>

<p>When I preform this query</p>

<pre><code>select distinct on (column2) * from demo_table 
</code></pre>

<p>it gives me out put as this</p>

<pre><code>id  | column1 | column2
 5  |    5    |    4
 6  |    6    |    3
</code></pre>

<p>I am looking for query where I can get output as </p>

<pre><code>id  | column1 | column2
 3  |    3    |    4
 5  |    5    |    4
 6  |    6    |    3
 4  |    4    |    3
</code></pre>

<p>it should give two row where column2 is distinct.</p>