Re: counts of groupings by date year-month - Mailing list pgsql-sql

From Tom Lane
Subject Re: counts of groupings by date year-month
Date
Msg-id 24305.1235771409@sss.pgh.pa.us
Whole thread Raw
In response to counts of groupings by date year-month  (Carol Cheung <cacheung@consumercontact.com>)
List pgsql-sql
Carol Cheung <cacheung@consumercontact.com> writes:
> I tried something like
> SELECT to_char(access_date, 'YYYYMM') as year_month, count(year_month) 
> FROM temp GROUP BY year_month ORDER BY year_month;

The only problem in what you wrote was the illegal cross-reference
from one output column to another.  Just use count(*) instead.
        regards, tom lane


pgsql-sql by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: counts of groupings by date year-month
Next
From: Andreas Kretschmer
Date:
Subject: Re: counts of groupings by date year-month