Carol Cheung <cache...@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 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql