group by date_part

From: M(dot)Mazurek(at)poznan(dot)multinet(dot)pl
To: pgsql-sql(at)postgresql(dot)org
Subject: group by date_part
Date: 2000-02-20 23:33:46
Message-ID: Pine.BSF.4.21.0002202332360.72356-100000@arka.poznan.mtl.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

HI,
I have a table with some statistics and datetime field (data). I want
select counted records by day of the week.

select count (*) from stats group by date_part('dow',data::datetime_;

I get everthing sortded just as I wanted to, but how can I ad another
column to know which dow it is?
eg:
dow|count
---------
0 |123
4 | 322
...

mazek

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message jdb371 2000-02-21 00:39:47 it wont let me delete
Previous Message Joe Conway 2000-02-20 19:55:18 pltcl and LDAP