Re: converting a N rows table to a 1 row table ?

From: Pujol Mathieu <mathieu(dot)pujol(at)realfusio(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: converting a N rows table to a 1 row table ?
Date: 2014-07-03 12:46:41
Message-ID: 53B550B1.8080700@realfusio.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general


Le 03/07/2014 14:30, Arup Rakshit a écrit :
> Hi,
>
> One query is producing the below table :-
>
> answer | count | avg
> a1 3 14
> a2 2 10
>
> How to convert this to a single row table ?
>
> count | avg_a1 | avg_a2
> 5 14 10
> Regards,
> Arup Rakshit
Hi,
Could you have multiple row with same answer ?
If I understand you one row and N + 1 column where N is the number of
answer ?
Regards

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Curvey 2014-07-03 12:53:53 Re: converting a N rows table to a 1 row table ?
Previous Message Arup Rakshit 2014-07-03 12:30:13 converting a N rows table to a 1 row table ?