Re: pivot query with count

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: pivot query with count
Date: 2013-04-13 03:26:05
Message-ID: 1365823565069-5752077.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

SELECT num_ads, sum(...), sum(...), ....
FROM ( your query here )
GROUP BY num_ads;

BTW, While "SELECT '1' "num_ads" is valid syntax I recommend you use the
"AS" keyword. '1' AS "num_ads"

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/pivot-query-with-count-tp5752072p5752077.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Johnston 2013-04-13 03:29:15 Re: pivot query with count
Previous Message Tony Capobianco 2013-04-13 00:28:33 pivot query with count