Re: pivot query with count - Mailing list pgsql-sql

From David Johnston
Subject Re: pivot query with count
Date
Msg-id 1365823565069-5752077.post@n5.nabble.com
Whole thread Raw
In response to pivot query with count  (Tony Capobianco <tony.capobianco1@gmail.com>)
Responses Re: pivot query with count  (David Johnston <polobo@yahoo.com>)
List 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.



pgsql-sql by date:

Previous
From: Tony Capobianco
Date:
Subject: pivot query with count
Next
From: David Johnston
Date:
Subject: Re: pivot query with count